Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. How to load xml file in mozillla

How to load xml file in mozillla

Scheduled Pinned Locked Moved XML / XSL
javascripthtmltoolsxmlhelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    biswa47
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • B biswa47

      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

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      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

      B 1 Reply Last reply
      0
      • S Stuart Dootson

        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

        B Offline
        B Offline
        biswa47
        wrote on last edited by
        #3

        HI, Stuart Dootson. Will you kindly give me ur code in which u have successfully loaded the xml file in to mozilla

        S 1 Reply Last reply
        0
        • B biswa47

          HI, Stuart Dootson. Will you kindly give me ur code in which u have successfully loaded the xml file in to mozilla

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          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

          B 1 Reply Last reply
          0
          • S Stuart Dootson

            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

            B Offline
            B Offline
            biswa47
            wrote on last edited by
            #5

            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.

            S 1 Reply Last reply
            0
            • B biswa47

              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.

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups