Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > ajax working only with mozilla

Reply
Thread Tools

ajax working only with mozilla

 
 
Mariano
Guest
Posts: n/a
 
      02-06-2008
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?
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-06-2008
Mariano wrote:
> 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?




--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Mariano
Guest
Posts: n/a
 
      02-06-2008
On 6 Feb, 18:46, Martin Honnen <(E-Mail Removed)> wrote:
> Mariano wrote:
> > 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?
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/


there aren't error message, just freezed interaction!
 
Reply With Quote
 
Mariano
Guest
Posts: n/a
 
      02-07-2008
On 7 Feb, 01:30, Jeff <jeff@spam_me_not.com> wrote:
> Mariano wrote:
> > On 6 Feb, 18:46, Martin Honnen <(E-Mail Removed)> wrote:
> >> Mariano wrote:
> >>> 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?

>
> >> --

>
> >> Martin Honnen
> >> http://JavaScript.FAQTs.com/

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

>
> Why don't sprinkle in some alerts so you can see where it freezes?
>
> Jeff


So in that code there aren't visible error in cross-browsing???
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      02-07-2008
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.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
Mariano
Guest
Posts: n/a
 
      02-10-2008
On 7 Feb, 16:28, Jeff <jeff@spam_me_not.com> wrote:
> Martin Honnen wrote:
> > 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?
>
> 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.
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      02-10-2008
Mariano wrote:
> On 7 Feb, 16:28, Jeff <jeff@spam_me_not.com> wrote:
>> Martin Honnen wrote:
>>> 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_not...ml#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
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ajax response not working on mozilla =?Utf-8?B?cGF0cmlja2RyZA==?= ASP .Net 2 02-16-2007 12:25 AM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
DIV Pops not working for Netscape/Mozilla etc... -- only IE John Javascript 2 06-25-2004 11:27 PM
Mozilla only half working cwj Javascript 1 01-11-2004 04:09 PM
mozilla 1.5 from mozilla 1.4 Disco Firefox 6 11-07-2003 04:34 PM



Advertisments