Results 1 to 3 of 3

Thread: strange ajax responsetext issue

  1. #1
    Join Date
    Jun 2008
    Posts
    53
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default strange ajax responsetext issue

    Hopefully a quick question.

    in a file I call a function ending with
    Code:
    text = xmlhttp.responseText;
    	//alert('more: '+text); (commented on purpose for this example)
    return text;
    (this is an ajaxform submission thing)

    in the calling function:
    Code:
    text = ajaxformSP(val, handler, form);
    			alert('try: '+text);
    If I uncomment the alert in the first code snippet, I get an alert with "Try: and the correct response text".

    If I leave it commented, the alert 'try '+ text has null or nothing for text.
    Anyone have any idea why, and also, Any idea how I can deal with this issue without having to make an alert?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Is:

    Code:
    text = xmlhttp.responseText;
    part of a function that's called on the xmlhttp.onreadystatechange, and are you testing for xmlhttp.readyState == 4 before assigning the xmlhttp.responseText to text?
    Last edited by jscheuer1; 01-09-2009 at 05:05 PM. Reason: spelling
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Irishjugg (01-09-2009)

  4. #3
    Join Date
    Jun 2008
    Posts
    53
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Hhh, thanks jscheuer :] I am now. Huge brain fart there.

Bookmarks

Posting Permissions

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