jamesxg1 Posted January 20, 2010 Share Posted January 20, 2010 Hi Everyone! How do I use a javascript var in jquery ? function postNewAnswerAlerts() { if (http_request.readyState == 4) { if (http_request.status == 200) { var result = http_request.responseText; $('div#question').load('responder.php?mode=readquestion&id='+result).show().fadeIn('slow'); } } } I need to use this javascript var var result = http_request.responseText; in $('div#question').load('responder.php?mode=readquestion&id='+result).show().fadeIn('slow'); Many thanks James. Link to comment https://forums.phpfreaks.com/topic/189200-how-do-i-use-javascript-varible-in-jquery/ Share on other sites More sharing options...
jamesxg1 Posted January 20, 2010 Author Share Posted January 20, 2010 B to the U to the M to the P Link to comment https://forums.phpfreaks.com/topic/189200-how-do-i-use-javascript-varible-in-jquery/#findComment-998893 Share on other sites More sharing options...
jamesxg1 Posted January 20, 2010 Author Share Posted January 20, 2010 BUMP Link to comment https://forums.phpfreaks.com/topic/189200-how-do-i-use-javascript-varible-in-jquery/#findComment-998918 Share on other sites More sharing options...
trq Posted January 20, 2010 Share Posted January 20, 2010 the code you have should work. However, one question. Why are you using your own Ajax implementation? jQuery provides a much more user friendly interface. Link to comment https://forums.phpfreaks.com/topic/189200-how-do-i-use-javascript-varible-in-jquery/#findComment-998925 Share on other sites More sharing options...
jamesxg1 Posted January 20, 2010 Author Share Posted January 20, 2010 It doesn't . Good question ? lmao. Many thanks James. Link to comment https://forums.phpfreaks.com/topic/189200-how-do-i-use-javascript-varible-in-jquery/#findComment-998928 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.