Dan*_*cer 17 jquery jquery-mobile
我想在页面中的所有动态链接上附加一个查询字符串 - 修复旧版本中的错误 - 这可能吗?
有任何想法吗?
Pau*_*ing 40
像这样的东西?
var querystring = 'myquerystringtoadd';
$('a').each(function() {
var href = $(this).attr('href');
if (href) {
href += (href.match(/\?/) ? '&' : '?') + querystring;
$(this).attr('href', href);
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14761 次 |
| 最近记录: |