javascript - Assistance with jquery variables -



javascript - Assistance with jquery variables -

today need help jquery, not have much knowledge of. in next code, have "variablecommentlimitneedstogehere," how set variable have defined commentlimit. have tried many different things, have had no success. thanks!

<input type='hidden' id='commentlimit' value='8'/> <script> $(window).scroll(function () { if ($(window).scrolltop() >= $(document).height() - $(window).height()) { document.getelementbyid("loadingcomments").style.display = 'block'; var commentlimit = document.getelementbyid('commentlimit').value; $('#load').load('getprofilecomments.php?username=<?php echo $profilename; ?>&commentlimit=variablcommentlimitneedstogohere'); //alert('end of page'); } }); </script>

$('#load').load('getprofilecomments.php?username=<?php echo $profilename; ?>&commentlimit=' + commentlimit);

jquery based on javascript, it's same syntax :)

ps if you're using jquery, can lot of things easier:

var commentlimit = $("#commentlimit").val();

$("#loadingcomments").css("display", "block");

javascript jquery

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -