How to load xml file in mozillla
-
Hi dear friends, from last few days i am digging my head like anything for loading rss feed(its nothing but a xml file) in to mozilla browser. i am succesfully load that and displayed in IE but unable to load it in mozzlia.here the link for rss feed is-"http://www.ed.gov/rss/edgov.xml". here i am able to dtect the browser but unable to load it in mozilla plz help me out.
<!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> <title>Untitled Page</title> <script type="text/javascript"> if(navigator.appName == "Netscape") { alert("You're using a Netscape browser.") function loadXML() { var xmlDoc = document.implementation.createDocument("", "", null) xmlDoc.load("http://www.ed.gov/rss/edgov.xml"); xmlDoc.onload = readXML; alert("hi") document.getElementById("title").innerHTML= xmlDoc.getElementsByTagName("title")[2].firstChild.nodeValue document.getElementById("description").innerHTML= xmlDoc.getElementsByTagName("description")[2].firstChild.nodeValue document.getElementById("title1").innerHTML= xmlDoc.getElementsByTagName("title")[3].firstChild.nodeValue document.getElementById("description1").innerHTML= xmlDoc.getElementsByTagName("description")[3].firstChild.nodeValue document.getElementById("title2").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue document.getElementById("description2").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue document.getElementById("title3").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue document.getElementById("description3").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue document.getElementById("title4").innerHTML= xmlDoc.getElementsByTagName("title")[5].firstChild.nodeValue document.getElementById("description4").innerHTML= xmlDoc.getElementsByTagName("description")[5].firstChild.nodeValue document.getElementById("title5").innerHTML= xmlDoc.getElementsByTagName("title")[6].firstChild.nodeValue
-
Hi dear friends, from last few days i am digging my head like anything for loading rss feed(its nothing but a xml file) in to mozilla browser. i am succesfully load that and displayed in IE but unable to load it in mozzlia.here the link for rss feed is-"http://www.ed.gov/rss/edgov.xml". here i am able to dtect the browser but unable to load it in mozilla plz help me out.
<!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> <title>Untitled Page</title> <script type="text/javascript"> if(navigator.appName == "Netscape") { alert("You're using a Netscape browser.") function loadXML() { var xmlDoc = document.implementation.createDocument("", "", null) xmlDoc.load("http://www.ed.gov/rss/edgov.xml"); xmlDoc.onload = readXML; alert("hi") document.getElementById("title").innerHTML= xmlDoc.getElementsByTagName("title")[2].firstChild.nodeValue document.getElementById("description").innerHTML= xmlDoc.getElementsByTagName("description")[2].firstChild.nodeValue document.getElementById("title1").innerHTML= xmlDoc.getElementsByTagName("title")[3].firstChild.nodeValue document.getElementById("description1").innerHTML= xmlDoc.getElementsByTagName("description")[3].firstChild.nodeValue document.getElementById("title2").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue document.getElementById("description2").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue document.getElementById("title3").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue document.getElementById("description3").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue document.getElementById("title4").innerHTML= xmlDoc.getElementsByTagName("title")[5].firstChild.nodeValue document.getElementById("description4").innerHTML= xmlDoc.getElementsByTagName("description")[5].firstChild.nodeValue document.getElementById("title5").innerHTML= xmlDoc.getElementsByTagName("title")[6].firstChild.nodeValue
Strange - I can load the URL (http://www.ed.gov/rss/edgov.xml) directly into FireFox, but using your code, I get this error in the Firebug console: Access to restricted URI denied" code: "1012 An aside - if you're using Firefox (and as you're using Mozilla, seems highly likely), use Firebug to help you debug your Javascript - it's an awesome tool! In addition, I would also recommend using a Javascript library like jQuery or Prototype (I have experience of jQuery, but not Prototype) for cross-browser DOM manipulation like this - they allow you to a) write your code as if there was only one browser - the library will deal with the browser differences, and b) simplify your code significantly.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Strange - I can load the URL (http://www.ed.gov/rss/edgov.xml) directly into FireFox, but using your code, I get this error in the Firebug console: Access to restricted URI denied" code: "1012 An aside - if you're using Firefox (and as you're using Mozilla, seems highly likely), use Firebug to help you debug your Javascript - it's an awesome tool! In addition, I would also recommend using a Javascript library like jQuery or Prototype (I have experience of jQuery, but not Prototype) for cross-browser DOM manipulation like this - they allow you to a) write your code as if there was only one browser - the library will deal with the browser differences, and b) simplify your code significantly.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
HI, Stuart Dootson. Will you kindly give me ur code in which u have successfully loaded the xml file in to mozilla
No code - I typed the URL into the address bar...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
No code - I typed the URL into the address bar...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
hai man.. i know dat link is working fine over mozilla browser.but my requirmnet is different.. i need to embeded the rss feeds inside that xml into html page dynamically.
Yes, I know. My first action was to save your code and run it - at which point I got the error message I described. So, I tried the URL via the address bar and it worked. I've since found this page[^], which describes the error message, but in relation to jQuery. It tells you that FireFox's security model is stopping you access the page.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p