小编Nic*_*coF的帖子

如何使用jQuery获取剥离的图像名称?

假设我有一个带有src ="img/highlow.png"的img元素.

怎么可以去掉alert('highlow');

jquery image path strip

3
推荐指数
2
解决办法
4149
查看次数

使用jQuery更新href中的查询字符串值

我有3个具有不同结构的href,并且它们都具有相同的硬编码参数(在此示例中值= somevalue-abc).

如何更新链接并使用新值覆盖值?

jQuery的

$(document).ready(function () {

    $('a').click(function () {

        var $newValue = 'newvalue';

        //here a function that overwrites the parameter 'somevalue-abc' with $newValue

    });

});
Run Code Online (Sandbox Code Playgroud)

HTML

<a class="demo" href="http://www.mydomain.com/page.aspx?demo&value=somevalue-abc">link 1</a>
<a class="real" href="http://www.mydomain.com/?value=somevalue-abc#go=yes">link 2</a>
<a class="outgoing" href="http://www.mydomain.com/page.aspx?value=somevalue-abc">link 3</a>
Run Code Online (Sandbox Code Playgroud)

jquery query-string

3
推荐指数
2
解决办法
4558
查看次数

标签 统计

jquery ×2

image ×1

path ×1

query-string ×1

strip ×1