Page 1 of 2 12 LastLast
Results 1 to 10 of 11

This is a discussion on NETWORK_ERR: XMLHttpRequest Exception 101 within the Chrome Troubleshooting section, part of the Google Chrome category: Suddenly (i.e. after the version 5 update) Chrome is giving the error in the title (above) at seemingly random moments ...


  1. #1
    jaschulz is offline Junior Member
    Join Date
    Jan 2010
    Posts
    12

    Default NETWORK_ERR: XMLHttpRequest Exception 101

    Suddenly (i.e. after the version 5 update) Chrome is giving the error in the title (above) at seemingly random moments (when I do a local Ajax "get"). Until today, I had never seen this error, and my Ajax code has not changed. It looks like this:
    Code:
    	function getAjaxText(content, target, textPath, characters) {
    		nc.http_request = false;
    		// running locally on IE5.5, IE6, IE7 
    		if ((location.protocol=="file:")&&(window.ActiveXObject)) {  
    			if (!nc.http_request) try { 
    				nc.http_request=new ActiveXObject("Msxml2.XMLHTTP"); 
    			}catch(e){
    				nc.http_request=false;
    			}
    			if (!nc.http_request) try { 
    				nc.http_request=new ActiveXObject("Microsoft.XMLHTTP"); 
    			} catch(e) {
    				nc.http_request=false;
    			}
    		}
    		// IE7, Firefox, Safari, Opera... 
    		if (!nc.http_request) try {
    			nc.http_request=new XMLHttpRequest();
    		} catch(e) {
    			nc.http_request=false;
    		}
    		// IE6
    		if (typeof ActiveXObject != "undefined") {
    			if (!nc.http_request) try {
    				nc.http_request=new ActiveXObject("MSXML2.http_request"); 
    			}	catch(e) {
    				nc.http_request=false;
    			}	
    			if (!nc.http_request) try {
    				nc.http_request=new ActiveXObject("Microsoft.http_request"); 
    			} catch(e) {
    				nc.http_request=false;
    			}	
    		}		
    		if (window.XMLHttpRequest) { // Mozilla, Safari,...
    			if (nc.http_request.overrideMimeType) {  nc.http_request.overrideMimeType('text/plain; charset=' + characters);  }
    		} 
    		if (!nc.http_request) {
    			alert('ERROR: Cannot create an XMLHTTP instance');
    			return false;
    		}
    		nc.http_request.onreadystatechange = function() { nc.showAjaxText(content, target); }
    		nc.http_request.open('GET', textPath + content, true);
    		nc.http_request.send(null);
    	}
    Where is this error coming from? And how do I avoid it?

    Thanks,

    JAS

  2. #2
    Waha's Avatar
    Waha is offline Senior Member
    Join Date
    Apr 2009
    Location
    Oregon
    Posts
    788

    Default

    Where is this code used? Are you trying to do a cross-site request? Can you go to the page normally in your browser and have it work?
    That error is caused by a general upset in the transfer after the send command, so it could be any number of things. :S
    ~ Projects ~
    Specialized: Carapass Auction Watcher, Kongregate Chat
    Libraries: bliplib
    Tools: manifest syntax highlighting & snippits
    ~ Happy to make extensions for pay too ;D ~
    Portfolio: Search and Share

  3. #3
    jaschulz is offline Junior Member
    Join Date
    Jan 2010
    Posts
    12

    Default

    No there is no cross-site attempt. The problem occurs when I am loading a local file via an Ajax call. It is irregular, but I never saw it before today, and the only thing that changed over night was the Chrome 5 update.

    The page works fine when served (locally) by IIS or when I access it on the web, but if I simply load it in the browser (without starting IIS), it may work the first two of three times, but once it gives the error, it (the error persists) until I reboot (at least that's the only way I have found to clear the error so far).

    JAS

  4. #4
    Waha's Avatar
    Waha is offline Senior Member
    Join Date
    Apr 2009
    Location
    Oregon
    Posts
    788

    Default

    Personally I wouldn't want to test AJAX from the file:// schema, it's unclear to me how it would decide the XSS permissions, so I figure it would be to the developers/program as well.
    If it's working when served locally/online there's probably not an error in your code at all. You should probably just stick to testing it through IIS.

    Can't really tell you what would be affecting it though. My only guess is unsurity.
    ~ Projects ~
    Specialized: Carapass Auction Watcher, Kongregate Chat
    Libraries: bliplib
    Tools: manifest syntax highlighting & snippits
    ~ Happy to make extensions for pay too ;D ~
    Portfolio: Search and Share

  5. #5
    jaschulz is offline Junior Member
    Join Date
    Jan 2010
    Posts
    12

    Default

    Let me give another example (that uses the code in my first message). It is a little app I wrote (for my own use, and that does not run on the web). It manages a collection of texts I downloaded from Gutenberg.org. It is, in effect, a simple ebook-reader that uses plain .txt files. I used to run it in a Chrome "application short-cut" and like that it was a very handy little local app. But, since the version 5 update, it doesn't work at all (giving the error I cited). It still works fine under Firefox and Safari, so the problem has to be Chrome. I hope somebody can tell me how i can fix this.

    Thanks,

    JAS

  6. #6
    misaelpc is offline Junior Member
    Join Date
    Jun 2010
    Posts
    1

    Default

    I have the same problem with my AJAX aplication , it worked fine till today I realized that it stopped working on chrome in a local execution, I hope Chrome solves this soon, my application runs everywhere,IE, mozilla, safari, opera an it was working fine in chrome also .

  7. #7
    jaschulz is offline Junior Member
    Join Date
    Jan 2010
    Posts
    12

    Default

    For what it's worth, I have found that if I have Chrome running, then my local AJAX apps work fine in their separate windows.

  8. #8
    ComputerScientist is offline Junior Member
    Join Date
    Jun 2010
    Posts
    1

    Default Latest Chrome release has broken Javascript XmlHttpRequest for loading local files

    We are experiencing the exact same problem.

    We have Javascript code that loads a local JSON file using xmlhttprequest.open + .send, this worked fine on 3 different machines as of 3 weeks ago. No code changes were made to our codebase, and the load function began failing on multiple Windows (XP and Win7) machines (as Chrome was begin updated?)

    The Javascript console gives only this cryptic message:

    testcase5.html: 1 Uncaught SyntaxError: Unexpected token )
    testcase5.js: 176 Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101

    Interestingly, our code still works fine on Microsoft IE which uses activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]

    We will look for a solution from Google, if nothing is forthcoming, we will abort our migration to Chrome and revert our dept. back to IE, and also pass this finding on to our IT dept.

  9. #9
    ninedays is offline Junior Member
    Join Date
    Dec 2009
    Posts
    2

    Lightbulb Use Apache

    I have this problem too, when use the Chrome dev tools I saw this error:

    XMLHttpRequest cannot load file.. Cross origin requests are only supported for HTTP.

    So I run my page in Apache and it worked like a charm! Somehow Chrome doesn't like local file access so you have to go through a server to make it work.

  10. #10
    azhagupandian is offline Junior Member
    Join Date
    Mar 2011
    Posts
    1

    Default

    Hi guys,

    This may be very late reply but it may be useful for some one searching like me. I too faced the same problem and i created a virtual directory in IIS and the issue is fixed.

    Thanks for your ideas

Page 1 of 2 12 LastLast

Posting Permissions

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