ajax working only with mozilla

M

Mariano

I have this use of XMLHTTPRequest, but working only with Mozilla like
browser, not working on IE7:

function ajaxRequest(func, src, type, p1) {
var mozillaFlag = false;
var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
//XMLHttpRequestObject.overrideMimeType("text/xml");
mozillaFlag = true;
} else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}

if(XMLHttpRequestObject) {
XMLHttpRequestObject.open(type, src, true);
XMLHttpRequestObject.onreadystatechange = function(){
if (XMLHttpRequestObject.readyState == 4 &&
XMLHttpRequestObject.status == 200) {
var xmlDocument = XMLHttpRequestObject.responseXML;
if(mozillaFlag){
removeWhitespace(xmlDocument);
}
aFunction(xmlDocument, p1);
}
}
XMLHttpRequestObject.send(null);
}
}

Someone have an idea?
 
M

Martin Honnen

Mariano said:
I have this use of XMLHTTPRequest, but working only with Mozilla like
browser, not working on IE7:

function ajaxRequest(func, src, type, p1) {
var mozillaFlag = false;
var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
//XMLHttpRequestObject.overrideMimeType("text/xml");
mozillaFlag = true;

Well IE 7 supports XMLHttpRequest as a DOM object and that way your code
with IE 7 ends up in this block and then sets that flag mozillaFlag to
true. Probably not what you want.

What exactly is the problem you have with IE 7? Do you get any error,
which one, for which statement?
 
M

Mariano

Well IE 7 supports XMLHttpRequest as a DOM object and that way your code
with IE 7 ends up in this block and then sets that flag mozillaFlag to
true. Probably not what you want.

What exactly is the problem you have with IE 7? Do you get any error,
which one, for which statement?

there aren't error message, just freezed interaction!
 
M

Martin Honnen

Mariano said:
So in that code there aren't visible error in cross-browsing???

You have neither shown the code of removeWhitespace nor of aFunction nor
the parameters passed to ajaxRequest so it is hard to tell.
 
M

Mariano

On a side note, does IE have anything similar to the Moz javascript:
error window?

Jeff

I think that it's not usefull to post removeWhiteSpace() and
aFunction() source. I have this page with 2 link, "Registration Form"
and "Login Form" the HTML page have onload event on the body tag that
call AjaxRequest executing a function with HTML code of a registration
form. And this working good, but if I click on Login Form, i should
call ajaxRequest with aFunction2 that shoul write Login HTMLcode. but
this don't happen.
 
T

Thomas 'PointedEars' Lahn

Mariano said:
Martin said:
Mariano wrote:
So in that code there aren't visible error in cross-browsing???
You have neither shown the code of removeWhitespace nor of aFunction nor
the parameters passed to ajaxRequest so it is hard to tell.
On a side note, does IE have anything similar to the Moz javascript:
error window?
[...]

Please don't quite signatures.
I think that it's not usefull to post removeWhiteSpace() and
aFunction() source. I have this page with 2 link, "Registration Form"
and "Login Form" the HTML page have onload event on the body tag that
call AjaxRequest executing a function with HTML code of a registration
form.

You can post a URL of the test case.
And this working good, but if I click on Login Form, i should
call ajaxRequest with aFunction2 that shoul write Login HTMLcode. but
this don't happen.

http://www.jibbering.com/faq/faq_notes/clj_posts.html#ps1DontWork
http://www.jibbering.com/faq/#FAQ4_43

<FAQENTRY>

FAQ entry 4.43 should be referred to in FAQ Notes entry
clj_posts.html#ps1DontWork

</FAQENTRY>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top