www.webdeveloper.com
Results 1 to 3 of 3

Thread: Unique problem

  1. #1
    Join Date
    May 2010
    Posts
    6

    Unique problem

    I am calling two ajax updater in one function. The second one takes the parameter from the first request updated select box.

    The problem is the second request takes the parameter from previous selectbox
    not the updated one.

    I tried syncronous request.but it didn't work

    if i put alert in between two ajax calls then it works properly

  2. #2
    Join Date
    Sep 2008
    Posts
    408
    Would say the callback for the new Ajax.Request have the secondary Ajax call in it. Otherwise they'll both run at the same time. Not sure why you'd need two Ajax calls for this though, can you not send back a JSON object with both the selectbox and the secondary selectbox from the server side?

    Code:
    <script type="text/javascript">
    	new Ajax.Request(
    		'/ajax.php',
    		method:'post',
    		parameters:{variable:'blah blah blah'},
    		onSuccess:function(transport) {
    			// Update the select box.
    			new Ajax.Request(
    				'/ajax.php',
    				method:'post',
    				parameters:{variable:'blah blah blah'},
    				onSuccess:function(transport) {
    					// Second call, this time the selectbox is updated.
    				}
    			);
    		}
    	);
    </script>
    Last edited by Shorts; 05-19-2010 at 01:34 AM.
    Mullanaphy!
    http://www.mullanaphy.com/

    Unless code is provided or an exact example is requested I think I'm going to start using psuedo code from now on...

    Also, I freelance as well. Inquire within!

  3. #3
    Join Date
    May 2010
    Posts
    6

    Done the same thing

    I had also done the same thing. I had solved the problem it was from the java code

    Thanx

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles