Anyone know of a good way to write a jQuery extension to handle query string parameters?(有人知道编写jQuery扩展来处理查询字符串参数的好方法吗?)
I basically want to extend the jQuery magic ($)
function so I can do something like this:(我基本上想扩展jQuery magic ($)
函数,所以我可以这样做:)
$('?search').val();
Which would give me the value "test" in the following URL: http://www.example.com/index.php?search=test
.(这将在以下URL中为我提供值“test”: http://www.example.com/index.php?search=test
: http://www.example.com/index.php?search=test
test。)
I've seen a lot of functions that can do this in jQuery and Javascript, but I actually want to extend jQuery to work exactly as it is shown above.(我已经看到很多函数可以在jQuery和Javascript中执行此操作,但实际上我希望扩展jQuery以完全按照上面所示的方式工作。) I'm not looking for a jQuery plugin, I'm looking for an extension to the jQuery method.(我不是在寻找一个jQuery插件,我正在寻找jQuery方法的扩展。)
ask by TroySteven translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…