php生成类的Jquery选择器


jquery selector for php-generated class

在wordpress中,我在post预览中创建了一个div,类似于

<div class="postbox">  
<h2><a class="showhide" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"><?php the_title(); ?></a></h2>  
<div class="post-<?php the_ID(); ?>"></div>
</div>

现在,我想为内部div创建一个jquery选择器

我已经定义了

var post_url = $(this).attr("href");
var post_id = $(this).attr("rel");

完成类似

的事情
 $(".post-"[post_id]).html("loading...");

Javascript字符串连接关闭。请尝试:

$(".post-" + post_url).html("loading...");