做頁面預覽的時候,數據沒有存入數據庫,但是要打開一個頁面進行預覽,詢問眾大嬸,原來是這樣來做。
1、父頁面
複製代碼代碼如下:
<input type="text" id="name" value="zhangsan"/>
<a href="a.html" target="_blank">預覽</a>
2、子頁面,也就是a.html獲取父頁面中文本框的value
複製代碼代碼如下:
$(function(){
console.info(window.opener.document.getElementById("name").value);
});
這樣控制台中出來的則是父頁面文本框的值
Don't hurry say have no choice, perhaps, next intersection will meet hope.