By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,131 Members | 1,494 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,131 IT Pros & Developers. It's quick & easy.

Problem with XMLHttpRequest and Firefox

mickey0
100+
P: 142
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.XMLHTTP');) all work. Why with firefox and Opera too it doesn't work?
Expand|Select|Wrap|Line Numbers
  1.     var req="null"; 
  2.     try {             
  3.       req = new XMLHttpRequest();
  4.     }
  5.  
  6.     catch (e) {     
  7.         alert("problem ");                 
  8.     }    
  9.  
Jan 19 '08 #1
Share this Question
Share on Google+
7 Replies


gits
Expert Mod 5K+
P: 5,333
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
Jan 19 '08 #2

mickey0
100+
P: 142
it was a little my error; However now the FF console gets this:
Error: uncaught exception:Permit denied method called XMLHttpRequest.open
to note: on IE6 (as I wrote before) it works.
Jan 19 '08 #3

gits
Expert Mod 5K+
P: 5,333
seems to be a cross-domain issue?
Jan 19 '08 #4

mickey0
100+
P: 142
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.responseText is ok)

EDIT: Opera console say this:
Expand|Select|Wrap|Line Numbers
  1. JavaScript - out.html
  2. Event thread: load
  3. Error:
  4. name: Error
  5. message: Security violation
  6.  
Jan 19 '08 #5

gits
Expert Mod 5K+
P: 5,333
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
Jan 19 '08 #6

mickey0
100+
P: 142
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?
Jan 19 '08 #7

Markus
Expert 5K+
P: 6,050
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.
Jan 19 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.