开发者

opening link in same window using jquery

开发者 https://www.devze.com 2023-02-02 21:10 出处:网络
.bind(\'click\',function(){ window.open($(this).find(\'.pc_more\').html()); }); }); is there something in this part of the code that tells it to open the link in a new page? can 开发者_如何转开发i pu

.bind('click',function(){ window.open($(this).find('.pc_more').html()); }); });

is there something in this part of the code that tells it to open the link in a new page? can 开发者_如何转开发i put some code to open the link in the same window?


You're looking for:

.bind('click', function(){
    window.location = $(this).find('.pc_more').html();
});

...assuming that the element matched by .pc_more really has a link as its HTML.

Live example


Try using window.location instead of window.open().

window.location = $(this).find('.pc_more').html();
0

精彩评论

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