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
Post a Comment