【发布时间】:2012-02-26 21:12:04
【问题描述】:
我可以使用 regex 和 javascript 从 url 中获取查询字符串:但我需要摆脱这些 %22...这些不会出现在 IE 中,只是在 FF 中。我该怎么做那?在 k=.. 但没有 %22..
<script type="text/javascript">document.write('<div class="DynamicSearchTitle">
Showing All Results For ' +
location.href.match(/\&k\=(.+)/)[1]+ ' Matches </div>');
</script>
网址
【问题讨论】:
-
网址无效。 “找不到页面”。
-
为什么需要 URL 才能工作?我刚刚包含了示例 URL ..真正的 url 还没有上线..
-
停止在你的查询字符串中使用空格和奇怪的字符,你应该是金色的?
-
我希望我能做到! Sharepoint 的奇怪世界有奇怪的方法来完成工作:)
-
请注意,使用
location.search可以更方便地提取查询字符串。
标签: javascript jquery regex query-string