Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用jquery在同一窗口中打开链接_Jquery - Fatal编程技术网

使用jquery在同一窗口中打开链接

使用jquery在同一窗口中打开链接,jquery,Jquery,.bind('单击',函数()){ window.open($(this.find('.pc_more').html()); }); }); 这部分代码中是否有什么东西告诉它在新页面中打开链接?我可以输入一些代码在同一窗口中打开链接吗?尝试使用window.location而不是window.open() 您正在寻找: .bind('click', function(){ window.location = $(this).find('.pc_more').html(); }); …假

.bind('单击',函数()){ window.open($(this.find('.pc_more').html()); }); });


这部分代码中是否有什么东西告诉它在新页面中打开链接?我可以输入一些代码在同一窗口中打开链接吗?

尝试使用window.location而不是window.open()

您正在寻找:

.bind('click', function(){
    window.location = $(this).find('.pc_more').html();
});
…假设与
.pc\u more
匹配的元素确实有一个链接作为其HTML


$pc_wrapper.find('.pc_item').hover(function(){$(this).addClass('selected');},function(){$(this).removeClass('selected');}).bind('click',function(){window location($(this).find('.pc_more').html());});这实际上是我应该首先粘贴的所有代码。我正在开发的网站上有一个面板,可以在屏幕上滑动,上面有图片。当您将鼠标放在图像上时,“pc_包装器”会出现,当您单击时,它会打开我在新页面中添加到图像的链接,并希望它在同一页面中打开等待nvm我找到了它!非常感谢!我只需要换一下。打开。位置。谢谢你的帮助=]@user:不用担心,很高兴你帮了忙。
.bind('click', function(){
    window.location = $(this).find('.pc_more').html();
});