截取地址栏传入的数据

地址栏:http://127.0.0.1/iweb-DAY06-ALL/iweb/course_detail.html?cid=10

需要截取cid的值。

var str=location.href;
var cid=str.substr(str.lastIndexOf('=')+1);

posted @ 2017-02-10 00:03  岁月`如梭  阅读(185)  评论(0编辑  收藏  举报