homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Ajax new user - Can't get any respnse
Ajax - no response

Msg#: 4409657 posted 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).



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4409657 posted 2:01 am on Jan 23, 2012 (gmt 0)

you need to set xmlhttp

var xmlhttp;
var xmlhttp = getXHR();

see link below for function getXHR


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved