我需要删除网址中的第一个“/”。正如您所看到的,我的第一个值是正确的,现在我需要对第二个网址执行相同的操作。怎么删除第一个“/”
option=com_content&view=article&id=2&Itemid=2 < CORRECT
/option=com_content&view=article&id=2&Itemid=2 < NOT GOOD FOR ME
Run Code Online (Sandbox Code Playgroud)
不同的方式
var rawurl = "/option=com_content&view=article&id=2&Itemid=2";
rawurl = rawurl.substr(rawurl.indexOf('/') + 1);