可能重复:
添加或更新查询字符串参数
我试图替换查询字符串中的页码,无论数字是1.
请求参数
index.php?list&page=2&sort=epub
Run Code Online (Sandbox Code Playgroud)
JavaScript的
window.location.href.replace(new RegExp("/page=.*?&/"), "page=1&")
Run Code Online (Sandbox Code Playgroud) 我试图将每行的单元格0与浏览器语言返回的字符串进行比较.防爆.浏览器语言是"en"匹配第3行的"en".$ row_num = 3.我的页面没有加载,这使我相信while语句是无限循环的.
PHP
$i = 0;
while ($i <= mysql_num_rows($lang_head_foot)-1) {
if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) == mysql_result($lang_head_foot, $i, 0)) {
$row_num = $i;
}
}
setcookie('dbs_lang', $row_num, time() + 60*60*24*365*10);
Run Code Online (Sandbox Code Playgroud) 我试图在点击"thead"时隐藏"arrow_o",但它无效.jquerys"孩子"不能在桌子上工作吗?
HTML
<thead class="thead">
<tr>
<th>
<div class="arrow_o"></div>
</th>
</tr>
</thead>
Run Code Online (Sandbox Code Playgroud)
JS
$(document).ready(function() {
$('.thead').click(function() {
$(this).children('.arrow_o').hide();
});
});
Run Code Online (Sandbox Code Playgroud)