Jump to content

Recommended Posts

Posted

Hi,

I want to load client machine xml file into my html page using XMLHTTP.

If I open the my file by giving

D:\xmlhttpPRG\loadXML.html

then it loads the xml file. This works fine but if I open this file by giving URL ie.

http://127.0.0.1/xmlhttpPRG/loadXML.html

then its gives an error "Permission denied"

 

><script language="javascript"> 
       var xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); 
       xmlhttp.Open("GET", "file:///C:/sample.xml", false); 
       xmlhttp.Send(); 
       alert(xmlhttp.responseText);
</script>

 

So, how can I load client machine xml file into my html page using URL.

If anybody knows the solution then pls send me the solution.

 

Thanks.

Posted

Welcome to the forums, sushilborhade! :)

 

To browse to a URL on your own machine (http://127.0.0.1/), you'd need 1) a web server of some kind running on your PC, and 2) the port that the web server uses must be open in your PC's firewall.

 

I suspect you're probably not running a web server on your local PC.

Posted

Welcome to the forums. In case you are looking for a web server that you can run locally to test out scripts and such before they are posted, try a google search for XAMMP.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...