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. Web Development
  3. JavaScript
  4. Running XMLHttpRequest in Firefox gives no results at all

Running XMLHttpRequest in Firefox gives no results at all

Scheduled Pinned Locked Moved JavaScript
questionjavascripthtmlcomtools
6 Posts 3 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
    bulrush400
    wrote on last edited by
    #1

    * Using Firefox v43. * Trying example at Simple and Practical Introduction to Asynchronous JavaScript and XML (AJAX)[^] * I'm a newbie here and with Javascript. If this isn't the right site for newbies just let me know. Some sites are somewhat hostile to newbies. * I do have Ublock Origin in FF, I don't know if that or FF is blocking popups or not. If so, how do I get FF to not block popups from local HTM files? I made the XML file and html file (which I called ajax1.htm) and opened it in Firefox. I clicked the button "ReadXML" and it did nothing, nothing changed in my browser. I'm trying to figure out if FF does not support XMLHttpRequest or if something else is going on. Do you have any ideas? EDIT: The bottom of ajax1.htm has been changed to this to test the Error() function via clicking a new button. I got no result from clicking the "Test error" button either. (The code formatting does not seem to be working.)

    </script>

    <script type="text/javascript">
    function testButton() {
    Error("This is an error");
    }

    </script>

    <body>
    <span id="xmlSpan"></span>
    <input type="button" onclick="ReadXmlFile();" value="ReadXml" />
    <input type="button" onclick="testButton();" value="Test Error" />

    Z Richard DeemingR 2 Replies Last reply
    0
    • B bulrush400

      * Using Firefox v43. * Trying example at Simple and Practical Introduction to Asynchronous JavaScript and XML (AJAX)[^] * I'm a newbie here and with Javascript. If this isn't the right site for newbies just let me know. Some sites are somewhat hostile to newbies. * I do have Ublock Origin in FF, I don't know if that or FF is blocking popups or not. If so, how do I get FF to not block popups from local HTM files? I made the XML file and html file (which I called ajax1.htm) and opened it in Firefox. I clicked the button "ReadXML" and it did nothing, nothing changed in my browser. I'm trying to figure out if FF does not support XMLHttpRequest or if something else is going on. Do you have any ideas? EDIT: The bottom of ajax1.htm has been changed to this to test the Error() function via clicking a new button. I got no result from clicking the "Test error" button either. (The code formatting does not seem to be working.)

      </script>

      <script type="text/javascript">
      function testButton() {
      Error("This is an error");
      }

      </script>

      <body>
      <span id="xmlSpan"></span>
      <input type="button" onclick="ReadXmlFile();" value="ReadXml" />
      <input type="button" onclick="testButton();" value="Test Error" />

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      1. The link you posted is to an article. Usually if you have a question about the article you post it at the bottom of the article. In this case I think it's still valid that you asked here. 2. Notice the date on that article, 2009. Quite old in tech years. I suggest using jQuery and calling .ajax() instead. There are tons of examples online and jQuery is a library that keeps up with the various browsers so the same code should work in all browsers. 3. See jQuery.ajax() | jQuery API Documentation[^] for documentation. 4. Also, if you choose to stick with your original question, edit it and post the relevant code.

      There are only 10 types of people in the world, those who understand binary and those who don't.

      1 Reply Last reply
      0
      • B bulrush400

        * Using Firefox v43. * Trying example at Simple and Practical Introduction to Asynchronous JavaScript and XML (AJAX)[^] * I'm a newbie here and with Javascript. If this isn't the right site for newbies just let me know. Some sites are somewhat hostile to newbies. * I do have Ublock Origin in FF, I don't know if that or FF is blocking popups or not. If so, how do I get FF to not block popups from local HTM files? I made the XML file and html file (which I called ajax1.htm) and opened it in Firefox. I clicked the button "ReadXML" and it did nothing, nothing changed in my browser. I'm trying to figure out if FF does not support XMLHttpRequest or if something else is going on. Do you have any ideas? EDIT: The bottom of ajax1.htm has been changed to this to test the Error() function via clicking a new button. I got no result from clicking the "Test error" button either. (The code formatting does not seem to be working.)

        </script>

        <script type="text/javascript">
        function testButton() {
        Error("This is an error");
        }

        </script>

        <body>
        <span id="xmlSpan"></span>
        <input type="button" onclick="ReadXmlFile();" value="ReadXml" />
        <input type="button" onclick="testButton();" value="Test Error" />

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        When you have a question about code in an article, it's usually best to post it in the forum at the bottom of the article[^]. That way, the author will be notified of your question and have a chance to respond. The person who wrote the code is the person most likely to be able to answer your question. :) Are you loading the page from a web site, or just double-clicking on the HTML file in Windows Explorer? You might have problems making AJAX requests work in a local file. Have you tried checking the Web Console[^] (F12) for error messages? Firefox definitely supports the XMLHttpRequest: XMLHttpRequest[^] Can I use... XMLHttpRequest advanced features[^] Error isn't a built-in function, and doesn't appear to be defined in the article's code. Try using alert instead:

        function testButton() {
        alert("This is an error");
        }


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        B 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          When you have a question about code in an article, it's usually best to post it in the forum at the bottom of the article[^]. That way, the author will be notified of your question and have a chance to respond. The person who wrote the code is the person most likely to be able to answer your question. :) Are you loading the page from a web site, or just double-clicking on the HTML file in Windows Explorer? You might have problems making AJAX requests work in a local file. Have you tried checking the Web Console[^] (F12) for error messages? Firefox definitely supports the XMLHttpRequest: XMLHttpRequest[^] Can I use... XMLHttpRequest advanced features[^] Error isn't a built-in function, and doesn't appear to be defined in the article's code. Try using alert instead:

          function testButton() {
          alert("This is an error");
          }


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          B Offline
          B Offline
          bulrush400
          wrote on last edited by
          #4

          I'm opening a local HTML file. And I didn't know Error() wasn't a standard function. So I'll look into that. Thanks. If I put the html file on a web server (I have an account on sdf.org) will Ajax work then? That sounds like a PITA if Ajax won't work in a local file.

          Richard DeemingR 1 Reply Last reply
          0
          • B bulrush400

            I'm opening a local HTML file. And I didn't know Error() wasn't a standard function. So I'll look into that. Thanks. If I put the html file on a web server (I have an account on sdf.org) will Ajax work then? That sounds like a PITA if Ajax won't work in a local file.

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            I'm not certain that it won't work from a local file; I've just seen a few issues crop up with local files that are resolved by using a web server. You don't need a live server to deploy it. You can use a local instance of IIS, or create a project in Visual Studio and use IIS Express. If you haven't got a copy of Visual Studio, you can get Community Edition for free: Free Dev Tools - Visual Studio Community 2015[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            B 1 Reply Last reply
            0
            • Richard DeemingR Richard Deeming

              I'm not certain that it won't work from a local file; I've just seen a few issues crop up with local files that are resolved by using a web server. You don't need a live server to deploy it. You can use a local instance of IIS, or create a project in Visual Studio and use IIS Express. If you haven't got a copy of Visual Studio, you can get Community Edition for free: Free Dev Tools - Visual Studio Community 2015[^]


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              B Offline
              B Offline
              bulrush400
              wrote on last edited by
              #6

              Sorry. I'm new here.

              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