1
我有一个外部页面添加到一个div,如果我写这它的工作原理jQuery的 - .load不工作
$(document).ready(function(){
$('div[align=center]:eq(1)').append('<br /><a class="linkone" href="#">Link 1</a><div class="testing"></div>');
$(".linkone").click(function(event) {
event.preventDefault();
var thelink = $('.blockhead a').filter('a[href^="http://site.com/gallery/photo/showgallery.php?cat="]').attr('href');
$(".testing").load("http://site.com/gallery/photo/showgallery.php?cat=1001 .forumrow table");
});
});
但如果我写这篇文章它不会工作
$(document).ready(function(){
$('div[align=center]:eq(1)').append('<br /><a class="linkone" href="#">Link 1</a><div class="testing"></div>');
$(".linkone").click(function(event) {
event.preventDefault();
var thelink = $('.blockhead a').filter('a[href^="http://site.com/gallery/photo/showgallery.php?cat="]').attr('href');
$(".testing").load("thelink .forumrow table");
});
});
哪有在.load后插入一个变量?
什么是您的网站的地址,因为如果不是site.com不同的,那么有没有办法通过AJAX –