var str = "/asdasf/asfaewf/agaegr/trer/rhh"; var index = str .lastIndexOf("\/"); str = str .substr ...
今天寫了一個URL 后面的字符串 來改變當前頁面的狀態 首先需要獲取當前頁面的URL console.log widow.location 之后頁面就會打印出來當前的URL 之后我們獲取URL后面的字符串 打印結果: 之后我們需要截取 后面的字符串 打印結果: 這樣就獲取到了 后面的字符串 之后需要分割字符串 打印結果: 所以整體下的代碼如下: 其中里面可會會有和我一樣剛學前端的同學們會弄不清su ...
2019-04-09 16:27 0 1681 推薦指數:
var str = "/asdasf/asfaewf/agaegr/trer/rhh"; var index = str .lastIndexOf("\/"); str = str .substr ...
java去除字符串后面的\0 ...
str為要截取的字符串 通過獲取字符串中“-”的坐標index,其他特殊字符以此類推 效果如圖, ...
function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring(index+1,obj.length ...
JS字符串截取(獲取指定字符后面的所有字符內容) function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring ...
function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring(inde ...
function getCaption(obj, text){ let index = obj.lastIndexOf(text) + text.length-1; obj ...
獲取到當前網址 var url = window.location.href; http://localhost:8080/exam_questions?type=3 //獲取url中的參數 function getUrlParam(name) { var reg = new ...