使用jQuery在同一窗口中打开链接 [英] opening link in same window using jquery

查看:350
本文介绍了使用jQuery在同一窗口中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

.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?

推荐答案

您在寻找:

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

...假设.pc_more匹配的元素确实具有一个链接,作为其 HTML .

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

实时示例

这篇关于使用jQuery在同一窗口中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆