SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Uncaught exception?

    Hello,

    I've had fully working website, but when few days ago some AJAX features do not work. I'm able to load data with AJAX, but when I try to send some data and get HTML response with AJAX, script doesn't work.

    I get this error:

    uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: website.com/en/destinations/United-States/4671654/Austin-travel-guide.html :: submitTranslateForm :: line 652" data: no]
    Lj(mouseout clientX=0, clientY=0, div#map)main.js (line 279)
    af(mouseout clientX=0, clientY=0)main.js (line 589)
    mj(mouseout clientX=0, clientY=0)
    I wonder, what does that mean? I guess problem is in submitTranslateForm (this is function that sends data using AJAX). But how can I find an error using error message above?

    Thanks.
    Last edited by al9; Apr 6, 2008 at 10:08.

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does your posting ajax code look like? Also, is the url you're posting to on the same domain (including subdomain) as the site the js is on?

  3. #3
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chris_fuel View Post
    What does your posting ajax code look like? Also, is the url you're posting to on the same domain (including subdomain) as the site the js is on?
    Yes, domain is the same. It always worked until now. It seems there is some conflict.

    The code is:

    Code:
    var AJAXsubmitTra = null;
    	
    	if (window.XMLHttpRequest) {
    		AJAXsubmitTra=new XMLHttpRequest();
    	}else{
    		AJAXsubmitTra=new ActiveXObject("Microsoft.XMLHTTP");
    	}
    
    	AJAXsubmitTra.onreadystatechange = function() {
    		if (AJAXsubmitTra.readyState==4 || AJAXsubmitTra.readyState=="complete"){
    			document.getElementById('translate').innerHTML = AJAXsubmitTra.responseText;
    		}
    	}
    
    
    function submitTranslateForm(geo, lang, page){
    	var url='http://www.roamearth.com/ajaxSubmitTranslateBox.php?&lang=' + lang + '&geo=' + geo + '&page=' + page + '&ansiname=' + document.getElementById("ansiname").value + '&name=' + document.getElementById("ansiname").value;
    	AJAXsubmitTra.open("GET", url, true);
    	AJAXsubmitTra.send(null);
    }

  4. #4
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One thing that might be doing it is: ?&lang= Not sure if browsers can interpret that. You might want to try Firebug too for debugging your AJAX posts and responses.

  5. #5
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chris_fuel View Post
    One thing that might be doing it is: ?&lang= Not sure if browsers can interpret that. You might want to try Firebug too for debugging your AJAX posts and responses.
    Actually, I use Firebug (the error message in the first post is generated by Firebug).

    I've fixed ?& thing, but script still doesn't work.

    If you have a minute, could you check this, maybe you will understand where the error is.

    Please go to:
    http://www.roamearth.com/en/

    Then login (login: test password: thetest)

    And then go to:
    http://www.roamearth.com/en/destinat...vel-guide.html

    Click "Translate name or fix incorrect translation" and you will see box (above the map) which is loaded by AJAX. But when you enter something like "Baden1" and click the button, you will get error.

    Normally, you will see new box above the map (new HTML data created by second AJAX call).


    I've spend few days, but I can't understand why doesn't this work. It should work, but it doesn't.

  6. #6
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you point me to the right direction please?


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
  •