Problem with XMLHttpRequest and Firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickey0
    New Member
    • Jan 2008
    • 142

    Problem with XMLHttpRequest and Firefox

    Hello,
    I'm trying to use XMLHttpRequest( ) with this code below but with firefox doesn't work, the exception raise! with IE6 (using new ActiveXObject(' Microsoft.XMLHT TP');) all work. Why with firefox and Opera too it doesn't work?
    Code:
        var req="null"; 
        try {             
          req = new XMLHttpRequest();
        }
        
        catch (e) {     
            alert("problem ");                 
        }
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    hi ...

    is there any other code that encloses the posted one? the posted code just works fine in FF 2.0.0.11 ...

    kind regards

    Comment

    • mickey0
      New Member
      • Jan 2008
      • 142

      #3
      it was a little my error; However now the FF console gets this:
      Error: uncaught exception:Permi t denied method called XMLHttpRequest. open
      to note: on IE6 (as I wrote before) it works.

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        seems to be a cross-domain issue?

        Comment

        • mickey0
          New Member
          • Jan 2008
          • 142

          #5
          Originally posted by gits
          seems to be a cross-domain issue?
          Is it a question? I don't know.....what am I wondering, again, why with IE it's OK (and the req.responseTex t is ok)

          EDIT: Opera console say this:
          Code:
          JavaScript - out.html
          Event thread: load
          Error:
          name: Error
          message: Security violation

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            since it had a questionmark at the end it should have been a question ;) ... so opera says the same as FF ... could you post the code you use for the request? the page and the requested data has to come from the same domain ... otherwise the XMLHttpRequest will not work ...

            kind regards

            Comment

            • mickey0
              New Member
              • Jan 2008
              • 142

              #7
              probably is the last you said (and this explain why IE work. Is this?). However: is there a way to do the request with FF?

              Comment

              • Markus
                Recognized Expert Expert
                • Jun 2007
                • 6092

                #8
                Originally posted by mickey0
                probably is the last you said (and this explain why IE work. Is this?). However: is there a way to do the request with FF?
                Post the full code you use!

                He can't tell you whats wrong just by looking at an error report.

                Comment

                Working...