Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I am calling php script using XMLHttpRequest from my server with
header('Access-Control-Allow-Origin: *') so that it can be access. It is working fine on Chrome and Firefox but it not working on IE8 and IE 9. It gives "TypeError: Access is denied.". Please let me know what is the best approach to resolve this issue.

Rgds
SNI
Posted

Please refer below link
http://www.w3schools.com/ajax/ajax_aspphp.asp[^]

hope so this will solve your problem...
 
Share this answer
 
Comments
SNI 26-Nov-13 6:21am    
Hi,
I tried with the examples given. I created a php file on my server and from html I am checking the hint but in IE8 it give Access Denied error when xhr tries to open the php script on my server. Please let me know what could be issue.
abdul04 26-Nov-13 6:29am    
look to thses article
http://stackoverflow.com/questions/13761877/same-domain-xmlhttprequest-access-denied-ie8
http://stackoverflow.com/questions/7964478/ie-8-security-settings-prevents-javascript-to-send-xmlhttprequest
Why dont you try jquery for this...

It would pretty much save your time

PHP
$.post( "ajax/test.php", function( data ) {
//"data" is some thing what you return as a output
  $( ".result" ).html( data );// apppends your data to the div name or something else where class name is  as result
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900