473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

XMLHttpRequest Issue

Hello,

var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "asdf.htm",true);

xmlhttp.onreadystatechange=function() {
//ALERT DOES NOT TRIGGER
alert("Status is "+ xmlhttp.readyState)
if (xmlhttp.readyState==4) {

if (xmlhttp.status==200) alert("URL Exists!")
else if (xmlhttp.status==404) alert("URL doesn't
exist!")
else alert("Status is "+xmlhttp.status)
}
}

I was wondering why the above alert wasn't triggering. The javascript
doesn't seem to have an error. Any ideas? Thanks.

Mar 21 '07 #1
1 1326
"jobo" <jo*****@gmail.comwrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
Hello,

var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "asdf.htm",true);

xmlhttp.onreadystatechange=function() {
//ALERT DOES NOT TRIGGER
alert("Status is "+ xmlhttp.readyState)
if (xmlhttp.readyState==4) {

if (xmlhttp.status==200) alert("URL Exists!")
else if (xmlhttp.status==404) alert("URL doesn't
exist!")
else alert("Status is "+xmlhttp.status)
}
}

I was wondering why the above alert wasn't triggering. The javascript
doesn't seem to have an error. Any ideas? Thanks.
Hehe. Did you try:

xmlhttp.send(null);

....?

-Lost
Mar 22 '07 #2

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

Similar topics

2
by: OraWiz | last post by:
Hi ! I have a problem using XMLHttpRequest (AJAX impl). I am getting the cached data all the time. heres the code. function loadDoc( url )
3
by: Sergey Surkov | last post by:
Hello Does anybody know how to make FireFox to cache data that comes via XMLHttpRequest? Here is the issue I deal with: - On the web server (apache2) I have a static xml file test.xml - When I...
22
by: googlegroups | last post by:
I am playing with the XMLHTTPRequest method to perform client/server transactions. I have it set up right now so that when readyState is 4, it takes the XML and processes it. This works great until...
5
by: francescomoi | last post by:
Hi. I'm trying to build a webpage which calls another one (at a different server) by using: var req = new XMLHttpRequest() I know some browsers (Mozilla and IE) doesn't allow it, and shows...
11
by: K | last post by:
Hey Guys, The problem i'm having is that our company is provided with a xml link. My job is to create a javascript menu based on the information retrieved from that link. We/I do not have access...
2
by: dx27s | last post by:
Hi all, I'm working with the XMLHttpRequest object. I receive the following error message: "Permission denied to call method XMLHttpRequest.open" This occurs in Firefox only. IE works fine. ...
42
by: Greg | last post by:
Hi, I've designed a bookmark in Ajax / PHP that I will put soon on sourceforge.net. But I've got an very tricky bug. I try it on some computers with Internet Explorer/Windows, Firefox...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
8
by: sbettadpur | last post by:
hello I am using xmlHttpRequest method in my application, this method is giving problem in the following browsers 1) Internet Explorer 7 2) Mozila Firefox(2.0.0.16) I got solution for...
1
by: sukil | last post by:
Hi, I have a requirement to generate a form based on various user selections at runtime. So, I am using XMLHttpRequest to call server side programs and passing them parameters that is then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.