473,473 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to give xmlhttp request for netscape browser

hi friends,

Exactly what i want to know is, In my product we are using
xmlhttp request to retrive some data from the server, And Im using IE
browser, its working fine in IE.
Now i want to work with netscape,I dont know how to pass the xmlhttp
request in Netscape. i got some code like below for netscape for
xmlhttp

var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);
oXML.send(null);
document.write(oXML.responseText);

but its not woking, it shows some uncaught exception error.

So can u suggest me some code for xmlhttp request for Netscape,Im using
version 8.1 netscape browser.

May 16 '06 #1
9 2357
ba*****************@gmail.com wrote:
hi friends,

Exactly what i want to know is, In my product we are using
xmlhttp request to retrive some data from the server, And Im using IE
browser, its working fine in IE.
Now i want to work with netscape,I dont know how to pass the xmlhttp
request in Netscape. i got some code like below for netscape for
xmlhttp
The only significant difference between IE and decent browsers is how
you create the object:
var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);
oXML.send(null);
document.write(oXML.responseText);

but its not woking, it shows some uncaught exception error.

Not surprised, it wouldn't work for IE like that either. Just create an
XMLHttpRequest object and use it as you currently do in IE.

--
Ian Collins.
May 16 '06 #2
yes i have done it too, atfer trying that only i came to do this code

var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);
oXML.send(null);
document.write(oXML.responseText);

Netscape is not working for above code.and also its not working for ,
that what im used for IE browser for xmlhttpRequest.

May 16 '06 #3


ba*****************@gmail.com wrote:

var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);


With the same origin policy you can only open connections to original
server your HTML document with the script came from.
Thus if your HTML document with the script comes from
http://example.com/ then you can open absolute URLs from
http://example.com/ or you can use relative URLs relative to
http://example.com/. You cannot however open connections to
http://google.com/. With normal security settings IE does not allow that
for the internet zone either so I assume you code working for IE is run
with lowerered security settings.
--

Martin Honnen
http://JavaScript.FAQTs.com/
May 16 '06 #4
ba*****************@gmail.com wrote:
yes i have done it too, atfer trying that only i came to do this code
Done what? Please do me the courtesy of quoting my message in your
response.
var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);
oXML.send(null);
document.write(oXML.responseText);

Netscape is not working for above code.and also its not working for ,
that what im used for IE browser for xmlhttpRequest.

What isn't working?

--
Ian Collins.
May 17 '06 #5
ba*****************@gmail.com wrote:
yes i have done it too, atfer trying that only i came to do this code

var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);
oXML.send(null);
document.write(oXML.responseText);

Netscape is not working for above code.and also its not working for ,
that what im used for IE browser for xmlhttpRequest.


Use a library, it will fix your IE and other browser woes:

<URL:http://www.ajaxtoolbox.com/>
But you may be stymied by the same-origin (security) policy as noted in
other replies.
--
Rob
Group FAQ: <URL:http://www.jibbering.com/faq/>
May 17 '06 #6
Hi Collins ,
Ill tell u clearly now,
Now in my product ,I have to retirve some data from the server, for
that im using xmlhttp request function in IE browser
the xmlhttp request function is given below

function RequestThroughXmlhttp(req)
{
/* These lines are common for all the xmlhttp request */
var xmlhttp,a;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
xmlhttp = new XMLHttpRequest();
if(!xmlhttp)
return;

/* Common Code ends here */

xmlhttp.open("POST", req , false);
xmlhttp.setRequestHeader("Content-Type","text/html")
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4)
{
if (xmlhttp.status == 200)
{
a = xmlhttp.responseText;
//alert(a);
}
else
if (xmlhttp.status != 200)
{ alert("Resource Not Available");
return;}
}
else
return;
}
xmlhttp.send();
xmlhttp.close;
return a;
}

this is function im using for xmlhttp request. In IE browser the above
funtion is working very fine.
but when i go to Netscape browser , this function is not
working to do xmlhttp request. so after that i searched and get some
code for xmlhttp request through some website for netscape browser.
that code is below

var oXML=new XMLHttpRequest();
oXML.open("GET","http://google.com",false);
oXML.send(null);
document.write(oXML.responseText);

but unfortunatly the above code is also not working on Netscape browser
for xmlhttp request.

So there is no problem with IE browser, Problem only with Netscape
only.

what i exactly need is ,I want a xmlhttp request code for netscape
browser.

Thank u

Rgrds...

Dinesh

May 18 '06 #7
ba*****************@gmail.com wrote:
Hi Collins ,
Ill tell u clearly now,
Now in my product ,I have to retirve some data from the server, for
that im using xmlhttp request function in IE browser
the xmlhttp request function is given below

function RequestThroughXmlhttp(req)
{
/* These lines are common for all the xmlhttp request */
var xmlhttp,a; just add

if( window.XMLHttpRequest ) // Mozilla, Safari,...
{
xmlhttp = new XMLHttpRequest();
}
else
{ try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
xmlhttp = new XMLHttpRequest();
if(!xmlhttp)
return;

/* Common Code ends here */

}

Also Please quote context next time.
--
Ian Collins.
May 18 '06 #8
hi collins

After modifing the code also,the xmlhttp is not working. Is there any
need to change any browser setting for Netscape for xmlhttp.

May 18 '06 #9
ba*****************@gmail.com wrote:
hi collins

After modifing the code also,the xmlhttp is not working. Is there any
need to change any browser setting for Netscape for xmlhttp.

You're still not quoting context, see <http://cfaj.freeshell.org/google/>
--
Ian Collins.
May 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Irene | last post by:
Hi, I have an asp page that allows a user to search for info in a DB and add info to a DB. The search uses "ADODB.Connection" objects in the page, but the add will use a call to an isapi dll...
5
by: Martin Waller | last post by:
Hello, I'm using the MSXML.XMLHTTP object to obtain the results of an ASP page from an ASP page on the same server. The problem I have is that when the AP refrenced by the XMLHTTP object is run...
3
by: kajol | last post by:
Hi everyone I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got a URL "http://www.bizrate.com/" which is causing a system...
1
by: Robert Cholewa | last post by:
Hi I'm using Microsoft.XMLHTTP object from within JavaScript HTA application (or WScript). Object is set to use asynchronous mode as following: --------- var oXMLRequest = new...
2
by: Jason Morehouse | last post by:
Hello, Anyone know if it's possible to speak with the server via xmlhttp.open while the browser is doing a post -- file upload in this case: <form enctype="multipart/form-data"...
3
by: Mark | last post by:
Hi all i was just wondering if you help. I have to send a cgi request to a company using xmlhttp request. They reply back with a line of info but when you view the internet explorer source code...
3
by: Ganesh | last post by:
I am a .NET Professional and working in web development. I found a bug (i think so) while using Request.Browser object to identify the browser name and version. It shows me the correct browser name...
3
by: JMcCrillis | last post by:
I've implemented a FileUpload servlet using AJAX and JS. It appears to be working well but for one issue. I used XMLHTTP so I could intercept the response in Javascript and write it out to a field...
2
by: trpost | last post by:
Is it possible to execute javascript as passed in xmlHttp.responseText Here is what I am doing: search.js var xmlHttp xmlHttp=GetXmlHttpObject() var url="search.php"...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.