CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    3

    Getting "Access to Restricted URI denied" error, but not using Cross-Domain??

    I'm creating an web mapping application with AJAX functionality. I'm also a little new to the use of AJAX so this is my first time using this.

    So I retrieve an XML file through my own web server. But the thing is, I'm getting this error message (Error code 1012) on my Error Console on Firefox, even though I'm not using any cross-domain referencing. The application works perfectly fine on IE though.

    I'm not sure if it has to do with the fact that I'm using a port number within the URL for the GET call (see code below).

    Here is a snippet of my javaScript file:

    Code:
    // initialize the XMLHttpRequest object
    if (window.XMLHttpRequest) {
    	// If IE7, Mozilla, Safari, and so on: Use native object.
    	xhr = new XMLHttpRequest();
    } else {
    	if (window.ActiveXObject) {
    		// ...otherwise, use the ActiveX control for IE5.x and IE6.
    		xhr = new ActiveXObject('MSXML2.XMLHTTP.3.0');
    	} else {
    		alert('XMLHttpRequest not supported. Your browser does not support XMLHttpRequest');
    	}
    }
    
    // handle xhr callback
    xhr.onreadystatechange  = function(){ 
    	if(xhr.readyState  == 4) { // if done loading url
    		if(xhr.status  == 200) {// if url is ok
    			myFunctionToHandleResponse(xhr.responseXML);
    		}else {
    			alert('An error occurred. XMLHttpRequest status code: ' + xhr.status);
    		}
    	}
    }
    
    // example URL format I'm using
    url = "http://webfeed.mywebserver.ca:9090/?SERVICE=EXT"
    url+= "&REQUEST=GetWarningInfo&INFO_FORMAT=text/xml
    url+= "&LON=58.446798&LAT=60.654948&TIME=2009-05-11T17:00:00Z"
    url+= "&MOREQUERY=blahblah"
    
    
    // AJAX call
    xhr.open('GET',url, true);
    xhr.send(null);
    My html file is on the same domain as my data feed:
    http://webfeed.mywebserver.ca/folder1/myhtml.html

    The URL returns basically an XML file.

    Anyone have any idea what my issue is? I'm completely stumped on this. Any help would be much appreciated.
    Last edited by kngai; May 11th, 2009 at 07:22 PM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured