我有这个jquery示例,只是想知道如何在下面的“var para1”中插入php(例如/a href="/?php echo $sample['SAMPLE\']; ?/"/)。
var storyIndictor = jQuery(_storyIndictors[position]);
var _content = jQuery("div.jqans-content", container);
var img = jQuery('<img style="float:left;clear:left;"></img>');
var para = jQuery('<div ></div>');
var para1 = jQuery('<h1> </h1>');
var title = jQuery(settings.contentTitle + " a", story).attr('title') || jQuery(settings.contentTitle, story).text();
img.attr('src', jQuery('img', story).attr('longdesc') || jQuery('img', story).attr('src'));
para1.html("<h1>" + title + "</h1>");
最佳答案
你可以只回显一个变量
var para1 = jQuery('<h1><?php echo $another_variable; ?></h1>');
关于javascript - 如何在jquery中插入php脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21037604/