私はrefferingていますラインは、私はloadmorecommentsuserpage.phpにGET経由の$ profilepageuseridを送りたいこのjavascriptコードに変数を含めるための正しい構文は何ですか?
url:"../php/loadmorecommentsuserpage.php?profilepageuserid=$profilepageuserid&lastComment="+$(".postedComment:last").attr("id"),
でするが、それは動作しません。
特に、$ profilepageuseridが表す値は送信されていません。構文は間違っていますか?
の$ profilepageuseridは、PHPで可変であり、私はJS
<script>
$(document).ready(function(){
$('div#text').click(function(){
$("div#text").hide();
$('div#loadMoreComments').show();
$.ajax({
url:"../php/loadmorecommentsuserpage.php?profilepageuserid=$profilepageuserid&lastComment="+$(".postedComment:last").attr("id"),
success:function(html){
if(html){
$("#postedComments").append(html);
$('div#loadMoreComments').hide();
$('div#text').show();
}else{
$('div#box').replaceWith("<div class='box'><center>Finished Loading the Comments</center></div>");
}
}
});
});
});
</script>
経由
「それは動作していません」とは何ですか?あなたは、何を修正する必要があるかについて具体的でない場合、あなたを助けることはできません。 –
<を試しましたか? echo $ profilepageuserid?>? – GillesC
はJSまたはPHPの '$ profilepageuserid'変数ですか? – Joseph