Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Ajax new user - Can't get any respnse

Ajax - no response



5:56 pm on Jan 22, 2012 (gmt 0)

I am trying to set Ajax up for a media server (hosting professor lectures).
I am trying to update my mysql, if someone likes a particular lecture.

However, I am not able to get any response what so ever. I am using an onclick - however, nothing happens. Check the code below - I have set up an if-else, with onreadyState, and for both the conditions (exhaustive), no change happens. Please suggest what I am doing wrong.

function show_jw()
var filepath=jwplayer('container').getPlaylistItem().file;
var xmlhttp;

if (xmlhttp.readyState==4 && xmlhttp.status==200)
document.getElementById("like").innerHTML="file found";
document.getElementById("like").innerHTML="file not found";

<input type="button" onclick=show_jw() value="like" />

on clicking the button, I should either see "file found" or "file not found". I see nothing (on chrome or firefox).


2:01 am on Jan 23, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

you need to set xmlhttp

var xmlhttp;
var xmlhttp = getXHR();

see link below for function getXHR


Featured Threads

Hot Threads This Week

Hot Threads This Month