頁面跳轉頁面帶引數並接收引數

2021-08-20 01:27:42 字數 446 閱讀 5194

因為專案中的一些問題需要用到window.location.href進行頁面跳轉但是還需要一些引數的傳遞,

window.location.href="/assets/html/man.html?id="+id;

這裡id就是我要傳遞到指定頁面的值,在指定頁面man.html怎麼進行解析出來這個id呢

var request = (function ();

var arr = window.location.search.slice(1).split("&");

for (var i = 0, len = arr.length; i < len; i++)

return obj;

})()

這是解析的方法,測試 這個時候可以列印出來id的值

console.log(request.id)

小結《跳轉頁面帶引數》

首先從乙個實體跳轉到另乙個窗體帶引數,參考的列子是 xrm.utility.openentityform entityname,賦值的guid,引數 function tocreatecontract var accountid xrm.page.getattribute customerid ge...

頁面跳轉引數接收

jsp 第乙個頁面 function taskrelease var idstr id array.join 將陣列元素連線起來以構建乙個字串 console.log idstr if idstr null idstr 第二個頁面初始載入函式接收物件解析 des 1 des 2 des 3 移除 d...

jq html 各種頁面帶引數

location.href xd02.html?value 9898 name 6 世上最簡單 方法一 function getquerystring name 呼叫方法 getquerystring value alert getquerystring 引數名1 alert getquerystr...