.bind('click',function(){ window.open($(this).find('.pc_more').html()); }); });
这段代码中有没有指示它在新页面中打开链接的内容?我能否添加一些代码以在相同窗口中打开链接?.bind('click',function(){ window.open($(this).find('.pc_more').html()); }); });
这段代码中有没有指示它在新页面中打开链接的内容?我能否添加一些代码以在相同窗口中打开链接?您正在寻找:
.bind('click', function(){
window.location = $(this).find('.pc_more').html();
});
.pc_more
匹配的元素确实具有链接作为其HTML,请参考以下示例:
尝试使用window.location而不是window.open()。
window.location = $(this).find('.pc_more').html();