簡體   English   中英

在JavaScript函數中從jsp的一頁訪問iframe到另一頁

[英]Accessing iframe from one page to another page of jsp in javascript function

我的Form1.jsp有iframe

<iframe id="results" name="results" style="display: none;"  
width="100%" height="240" frameborder="1"></iframe>

我想在我的form2.jsp中的javascript函數中訪問iframe id

function Hide() {
  if(document.getElementById("results").style.display=="none")  {
    document.getElementById("results").style.display="block";
  }
}

在地方結果字符串中,我想從Form1.jsp訪問iframe id

嘗試這個。

  1. 使用jsp重定向方法從Myform1.jsp重定向到Myform2.jsp

公共無效response.sendRedirect(“ Myform2.jsp /?formid = id”)引發IOException

將其添加到form1.jsp中。

id =您的ID,您要發送。

  1. 在form2.jsp中,閱讀Url並獲取查詢。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM