Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

returning and running a js function from ajax

  • 19-02-2007 11:36AM
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    Hi

    im using this script to toggle div's :
    http://simplejs.bleebot.com/

    the blind up and down effect is cool

    however im actually using ajax to save a form (this form is in a div which gets displayed with the toggle/blinddown function)

    after the ajax functionality is executed what i want to do is return js so as i can blindup/toggle that div

    at the moment i return

    <script type="text/javascript">
    $toggle('addrule');
    </script>


    but the problem is a page load would be required for this to take effect

    how can i return a js function from ajax and then call it ?


    tnx


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Post or attach the code for the entire page. It shouldn't be too difficult to implement.


  • Registered Users, Registered Users 2 Posts: 3,890 ✭✭✭cgarvey


    What is the response of the AJAX request? XML, text? You could write out plain text and do
    eval( myAJAXresponse.content() );
    
    adjusting for whatever AJAX library/code you're using. Throw in some exception handling for good measure.


Advertisement