$(document).click(function(){
getComments();
});
function getComments()
{
var directory = $(".active img").prop("src");
directory = directory.substring(58);
//alert(directory);
$("#photoComments").text(directory);
$.post('getPhotoComments.php', function(output){
//$("#photoComments").html(output);
$("#photoComments").html("jus checkin2").show();
});
}
以上是我的代码。一切工作,直到我开始$ .post的部分。 function()没有任何作用。我只是测试,看看它是否会将我的ID #photoComments设置为提供的文本:“jus checkin 2”,但似乎没有发生。请真的需要帮助。是的,我有“getPhotoComments.php”设置正确,并没有被使用。由于
你的意思是回调中的代码不会运行,或运行,但“只是检查”事不显示? –
任何错误讯息?任何来自Firebug(或类似)?我认为我们需要更多帮助你。 –
你可以告诉你getPhotoComments.php,如果你没有发布任何文件,然后使用得到... –