我正在尝试在页面上搜索文本,如果找到文本,则重新加载页面。
<p class="textmedium">These are the droids I'm looking for</p>
最佳答案
这应该做到:
if($('*:contains("These are the droids I\'m looking for")').length > 0) {
document.href.location = document.href.location; // refresh the page
}
关于javascript - 如果文本存在,则重新加载页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14778821/