tinfanide Posted October 10, 2011 Share Posted October 10, 2011 <?xml version="1.0" encoding="utf-8"?><root><marquee>marquee 1</marquee><marquee>marquee 2</marquee><marquee>marquee 3</marquee><marquee>marquee 4</marquee><marquee>marquee 5</marquee><marquee>marquee 6</marquee><marquee>marquee 7</marquee><marquee>marquee 8</marquee><marquee>marquee 9</marquee><marquee>marquee 10</marquee></root> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script>function parseXML(method,xml,async){if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); xmlhttp.open(method,xml,async); xmlhttp.send(); }else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") ; xmlhttp.async=async; xmlhttp.load(xml); }xmlDoc = xmlhttp.responseXML;}parseXML("GET","marquee.xml",false);function marquee(){for(var i=0; i<10; i++)document.getElementById("marquee").innerHTML += xmlDoc.getElementsByTagName("marquee")[i].childNodes[0].nodeValue+"<br />";}</script></head><body onload="marquee();"><marquee bgcolor="#FFFF99" width="300" height="100" id="marquee" behavior="scroll" direction="up" scrollamount="5"></marquee></body></html> My problem is strange. When the address is:http://localhost/marquee.htmlIt works in both FF & IE. When the address is:C:\xampp\htdocs\marquee.htmlIt just works in FF.(I'm using XAMPP at present.) In IE Developer Tool,This line: xmlhttp.open(method,xml,async); is considered: access denied What does it mean? And how can I fix it? Link to comment Share on other sites More sharing options...
Ingolme Posted October 10, 2011 Share Posted October 10, 2011 Internet Explorer does not allow Asynchronous HTTP requests on the local filesystem. Just keep using localhost, there's nothing wrong with your code. Link to comment Share on other sites More sharing options...
tinfanide Posted October 11, 2011 Author Share Posted October 11, 2011 Oh! I see. Learnt a thing, thanks a lot. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.