子頁面修改父頁面元素或頂層頁面元素
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<div id="div1">aaa</div>
<iframe src="left.jsp" id="iframe1"></iframe>
</body>
</html>
//************************************
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'left.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
window.onload=function(){
var oInput=document.getElementById('input1');
oInput.onclick=function(){
window.top.document.getElementById('div1').style.color='red';
window.parent.document.getElementById('div1').style.color='red';
}
}
</script>
</head>
<body>
<input type="button" value="改變" id="input1" />
</body>
</html>
相關推薦
子頁面修改父頁面元素或頂層頁面元素
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath
使某個頁面元素或整個頁面可編輯
1,把任何元素的contenteditable屬性設定成true,點選即可以編輯該元素的內容 <div id="editableDiv" style="width:240px;height:100px;background-color:#FEFF
子函式修改父函式的值
//子函式要想修改父函式的值,必須要①傳指標【例程式碼1】 ②解引用【例程式碼2】//但傳指標解引用也不一定能成功修改,因為可能有野指標【例程式碼3】 /*//【程式碼1】 :輸出結果為 10,20//【因為沒有傳指標,則Swap_err1
通過子元件修改父元件內的值
1.先在components下建立一個新的vue檔案,新增一些基本的配置。 2.在父元件中引用這個新建立的vue並註冊 import SelectItem from "./SelectItem" export default{ components:{SelectItem}
子節點修改父節點樣式(原生js和jquery)
<div id="parent"> 父標籤 <div id="children"> 子標籤 </div> </div> 一、原生js 只要獲取子節點物件,然後對其父節點的
React Native 子元件修改父元件的State
React Native 子元件傳遞State給父元件 一.原理 React本身是單向資料流,父元件可以傳遞props給子元件。 那麼假如要實現React / ReactNative 中父子元件通訊間的雙向資料流,思路可以是在這樣: 父元件向子元件
vue子元件修改父元件的三種方法
一直使用$emit觸發父元件的事件方法來實現改變父元件的值,導致把其他方法都給忘了。特別來整理下,加深下印象吧。 1. $emit('event', val) 最常用的一種方法,父元件通過v-on繫結一個事件,在事件中修改自己的值,子元件通過$emit觸發
轉 easyUI的iframe子頁面操作父頁面元素
itl 代碼 iframe yui com con 按鈕 頁面 tabs 曾經試過這樣的方法 在iframe子頁面獲取父頁面元素 代碼如下: $(‘#objId‘, parent.document); 這樣可以獲得父頁面的元素,但是
iframe子頁面與父頁面元素的訪問以及js變量的訪問
++ src 行修改 動態 class ria 方法 修改 左右 1、子頁面訪問父頁面元素 parent.document.getElementById(‘id‘)和document相關的方法都可以這樣用 2、父頁面訪問子頁面元素 document.
iframe子頁面獲取父頁面元素的方法
在iframe子頁面獲取父頁面元素 $.('#objld', parent.document); 在父頁面獲取iframe子頁面的元素 $("#objid",document.iframes('iframe').document)或$(document.g
子頁面呼叫父頁面中的dom元素並回傳資訊
當我們在多個頁面間做互動時免不了要進行頁面間的傳值問題,比如說下面就是這個的一個簡單的例子. 在這裡我們採用的是HTML DOM中的Browser 物件,該物件為我們提供了DOM Window物件,通過該物件下的open()方法,我們可以開
easyUI的iframe子頁面獲取父頁面元素和給父頁面元素賦值
iframe子頁面獲取父頁面物件 <script type="text/javascript"> function callback() { self.parent.$('#AdPicUrl').val();
子頁面返回父頁面的父頁面
ava mui text 功能 () 邏輯 子頁面 listen win 子頁面: <script type="text/javascript"> mui.init({ beforeback: function() { //獲得列表界面的web
bootstrap3-iframe-modal子頁面在父頁面顯示模態框
rbo 相關 belle 綁定 dism label bsp 打開 win 本文靈感來自:http://www.cnblogs.com/chengxuyuanzhilu/p/5132328.html 子頁面內容 //打開模態框 function openM
Vue子頁面給父頁面傳遞數據
mit info cli .info compute name component parent 子頁面 子頁面: <template> <div> <p>子組件</p> <button @click="sendMs
vue插槽,也就是子頁面、父頁面相互傳值的另一寫法
style def com data component rop 頁面 ret slot 父頁面: <template> <div class="parent"> <p>父組件</p> <child> &l
js之iframe子頁面與父頁面通信
瀏覽器 cti data pos href 事件 java win 兩種方法 iframe子頁面與父頁面通信根據iframe中src屬性是同域鏈接還是跨域鏈接,通信方式也不同。 一、同域下父子頁面的通信 父頁面parent.html <html> <h
CRM 2016 IFrame 函式修改 父頁面欄位
IFrame js 程式碼: parent.Xrm.Page.getAttribute("new_xxxx").setValue(123); 當然,可以設定 new_xxxx 欄位的OnChange 事件,這樣就可以通過OnChange事件
CRM 2016 IFrame 子頁面執行 父頁面函式
CRM 中定義以下函式: windows.parent.functionname(){ //do somethion } IFrame 子頁面呼叫 JS: windows.parent.functionname(); 簡單 alert(); 
微信小程式從子頁面返回父頁面實現資料的區域性重新整理
問題描述 A頁面有一個儲存欄位的物件陣列items,從A頁面跳轉到B頁面,B頁面自定義欄位,並新增到items中。當返回A頁面時,顯示items的部分能夠區域性重新整理 items:[{name: '0', value: '姓名', checked: true, isNecessar