开发者

jQuery - .load Not Working

开发者 https://www.devze.com 2023-03-26 00:14 出处:网络
I have to add an external page into a div, if i write this it works $(document).ready(function(){ $(\'div[align=center]:eq(1)\').append(\'<br /><a class=\"linkone\" href=\"#\">Link 1</

I have to add an external page into a div, if i write this it works

$(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");
            });
 });

But if i write this it wont work

$(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('hre开发者_JAVA百科f');
            $(".testing").load("thelink .forumrow table");
            });
 });

How can I insert a variable after .load?


$(".testing").load(thelink+" .forumrow table");
0

精彩评论

暂无评论...
验证码 换一张
取 消