Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ella Campbell   on Sep 10 In Java Category.

  
Question Answered By: Davi Costa   on Sep 10

Hi frist this is j2ee list not java script list! ;-)
second what is your browser? where are you downloading the page from?
I guess you are downloading page from one computer and sending request to another (like java applets) this is not allowed in AJAX.

"For security reasons, you can't use Ajax to request content from a domain outside of the current one. This is referred to as the Ajax sandbox."


you can open a cross browser object by this code:


if (window.XMLHttpRequest) {
// we have Mozilla, Opera or Safari
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
// we have IE
try {
xmlhttp = new ActiveXObject(" Msxml2.XMLHTTP");
} catch(e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlhttp = false;
}
}
}

Share: