If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Looking at your work it seems OK. The response status 0 may be due to the odditie of not having a valid URL. Check you final URL path to make sure it does actually point to you file. Put into you address bar of the browser to see if it opens the php file directly.

The variables likePath, likeFile and likeURL should not cause a problem if done right but I suggest you not do that till you sort out the problem. All of it can be included into one string with the value added at the end, but better still will be to put it into the open method bypassing the variables altogether.

I do not believe the alerts should cause any problems BUT please learn to use the browsers console.log feature to display all the information that you are trying to get from the alerts. You will be surprised what information you will find when you use it

Usually a status code of zero means the request failed at the very beginning. Maybe I've not understood your set up, but if the original page that is trying to access the program on your local server did not come from the server, but was invoked as, for example, "file:///whatever/whatever/zap.html" it will be considered as a cross domain request which will fail.

How do you activate the page that contains the javascript that makes the AJAX request? Is it also served up from the server? For example, does it start out because you've pointed your browser at "http://localhost/Moms/babyNames/index.html" ? If, on the other hand, you are activating the initial calling page by pointing your browser at the actual file, as in "file:///localhost/Moms/babyNames/index.html" this will indeed be interpreted as a cross domain request even though they are in the same directory.

Once again-- how is the initial page that makes the AJAX call invoked?

The original file that calls the javascript file is : http://localhost/Moms/babyNames/babyBoyNames.php. It is also served from the server. This file has few babynames which I click to initiate the javascript function that makes the AJAX request to like the baby name. This file is invoked when a user clicks "babyBoyNames" menu item on the website in localhost server.

Sorry--I have no idea what the problem may be. A status code of zero usually means that the network cannot be reached. Since the initial page loads I am somewhat mystified. Try this to see if it gives you any insight into what the error might be. Good luck.

Thanks grumpyOleMan and Tcobb. I was out not working for few days, so could not reply earlier.

It seems Firefox is bit slow than Google Chrome...firefox was replying status 200 once in a while...So I looked and looked...and found this dumb mistake I had ...By the time Chrome was getting status = 200, my page was reloading itself because I had <a href = " " > in the page... I am not sure if I am explaining it right...I changed it to <a href="#">.

Your replies and suggestions were so valuable to me...because of them I knew I was doing the Ajax part right, so I had to be really dumb somewhere else...thanks for putting up with me.