Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

returning and running a js function from ajax

Options
  • 19-02-2007 11:36am
    #1
    Registered Users 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 Posts: 7,468 ✭✭✭Evil Phil


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


  • Registered Users Posts: 3,886 ✭✭✭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