wapper Posted March 18, 2010 Share Posted March 18, 2010 Hello,I am a web developer and I just added XDomainRequest function in my script.By loading the page from the server, everything is fine(in IE, Firefox & Chrome), idem for local pages but not in IE & local pages means, for my problem, anywhere on the client PC, not localhost.Here are the piece of code that I am inspired: <script type='text/JavaScript'>function getXDomainRequest() { var xdr = null; if (window.XDomainRequest) { xdr = new XDomainRequest(); } else if (window.XMLHttpRequest) { xdr = new XMLHttpRequest(); } else { alert("Votre navigateur ne gère pas l'AJAX cross-domain !"); } return xdr; }var xdr = getXDomainRequest();xdr.onload = function() { alert(xdr.responseText);}xdr.open("GET", "http://www.foxycode.net/dev/ajax/XDomain_1.php ");xdr.send();</script> Please, if U can, explain in simple words, I'm really a newbie in english. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2010 Share Posted March 18, 2010 "xdr" and "xDr" are not the same thing. Link to comment Share on other sites More sharing options...
wapper Posted March 18, 2010 Author Share Posted March 18, 2010 I know, it isn't a "D" in my source code... maybe a bug on this bbcode parser...Then, it isn't the problem...EDIT: For the source code without smileys , please, look here:http://www.siteduzero.com/tutoriel-3-56320....html#ss_part_2 Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2010 Share Posted March 18, 2010 I'm confused about the problem, is the problem that you can't load files from your local computer? That will be a security setting with the browsers, that's not a problem with the code. Link to comment Share on other sites More sharing options...
wapper Posted March 18, 2010 Author Share Posted March 18, 2010 Sorry if it's because my poor english...I gonna try to explain that step by step:I have a html page with a JS script & some php scripts on my server.I want to invite the users to save this page on their pc.Then they will open this page and execute the JS functions contained in this page.Try my code, save it, for example, on your desktop & run it.On firefox & Chrome, no problem, it runs, but not on Internet Explorer (ACCESS DENIED) Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2010 Share Posted March 18, 2010 When I run the code you posted it works the same in IE8 and Firefox. Are you trying to double-click on the file and open it in IE, and then it fails? It should work if you access the file over HTTP, but when IE opens a local file it uses different security settings. You can't change the IE security settings in the code, you have to go into the Security options for IE and change what it is allowed to do. Link to comment Share on other sites More sharing options...
wapper Posted March 19, 2010 Author Share Posted March 19, 2010 Yes, local page, in this context, means opened by double-click...I tried to set the options for accept it but no results...Can U help me, please? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 19, 2010 Share Posted March 19, 2010 In IE, the settings you want to change are the security settings for the local zone. Play around with the options in there until you get it working like you want it to. Keep in mind that all of your users need to make the same changes in IE for your page to work. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.