【发布时间】:2015-05-21 13:16:18
【问题描述】:
我有一个这样的网址:
http://localhost/Customer/Edit/3
我需要检查 Customer/Edit/3 并将 3 替换为 jQuery 中的当前 ID (9)。
最终到达网址应类似于http://localhost/Customer/Edit/9
注意:替换必须仅适用于与客户相关的 URL。
我该怎么做?
【问题讨论】:
-
您需要制作一个正则表达式来匹配 Customer/Edit/3 并执行 myString.replace()。尝试编写一些代码并在遇到特定错误后返回此处。