點選超連結,將頁面中某個資料傳到另乙個頁面

2022-08-05 08:06:12 字數 1010 閱讀 1349

test

1234567890

測試二使用cookie儲存資料,在別的頁面獲取cookie值

使用localstorage儲存資料,在別的頁面獲取值

讀取url攜帶的資料時,還有另外一種方法

function

getrequest() }

return

therequest;

}

var request = new

object();

request =getrequest();

varv1;

v1 = request[''key''];

其他引數獲取介紹:

//設定或獲取物件指定的檔名或路徑。

1alert(window.location.pathname);

//設定或獲取整個 url 為字串。

1alert(window.location.href);

//設定或獲取與 url 關聯的埠號碼。

1alert(window.location.port);

//設定或獲取 url 的協議部分。

1alert(window.location.protocol);

//設定或獲取 href 屬性中在井號「#」後面的分段。

1alert(window.location.hash);

//設定或獲取 location 或 url 的 hostname 和 port 號碼。

1alert(window.location.host);

//設定或獲取 href 屬性中跟在問號後面的部分。

1alert(window.location.search);

用js把資料從乙個頁面傳到另乙個頁面

1.位址列傳參 然後在2.html頁面split 去擷取 2.ajax獲取另乙個頁面的資料 ajax 3.本地儲存sessionstorage 或 localstorage 兩者用法一樣 新增 3種方法 localstorage.infos aaaa localstorage infos aaaa ...

iOS 將乙個陣列中的資料插入到另乙個陣列中 總結

聯絡人 石虎暱稱 嗡嘛呢叭咪哄 要插入的位置 nsindexset helpindex nsindexset indexsetwithindexesinrange nsmakerange 1,sharr count 要插入的陣列 self helparr insertobjects helpsell...

js實現把乙個頁面層資料傳遞到另乙個頁面

由於之前面試,被問到過此問題,所以今天特意整理了一下。由於自己技術水平有限,若存在錯誤,歡迎提出批評。本部落格整理了兩種方式從乙個頁面層向另乙個頁面層傳遞引數。請輸入使用者名稱和密碼 input id username type text input id passwords type passwo...