0
我試圖將數據從子窗口傳遞到父窗口。如何使用Javascript和/或JSP將數據從子窗口傳遞到父窗口
我想使用opener.location.href =「test.jsp?param =」+ param +「」;
但它不斷給我下面的錯誤:「未捕獲的SyntaxError:意外的字符串」
我不知道爲什麼它給出了錯誤,因爲opener.location.href應該接受字符串。
這是我的孩子的JS代碼。
function something(){
var param = document.getElementById("input"); //where input is a text field
var link = 'http://localhost:8080/training/TestCases/test.jsp?param='+param'';
opener.location.href = link;
window.close();
}
一旦這個工作,我打算通過傳遞的參數,以獲得在我父母的JSP文件中的參數。
額外 '' 在鏈接的結束...... – 2014-11-07 00:48:57