第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

如下情況,我該如何去實(shí)現(xiàn)效果?有什么好辦法?

如下情況,我該如何去實(shí)現(xiàn)效果?有什么好辦法?

森林海 2022-12-17 18:14:57
情況是這樣的,先有一個(gè)頁面,點(diǎn)擊按鈕彈出對話框,里面有鏈接,點(diǎn)擊鏈接過去會切換到另一個(gè)列表頁,在這邊獲取數(shù)據(jù)確定之后關(guān)閉窗口,然后再最開始的頁面中獲取數(shù)據(jù)并顯示在一個(gè)對話框中,要如何實(shí)現(xiàn)呢。之前做過一個(gè)對話框中不切換頁面的,只需在對話框中用window.parent.setValue(數(shù)據(jù))就可以傳回去了,但是切換頁面后提示window.parent不支持setValue()對象。也試過window.showModalDialog()來打開對話框,然后通過window.returnValue()來返回參數(shù)。依然提示不支持returnValue()函數(shù)。注:setvalue是我自己寫的函數(shù)。
查看完整描述

2 回答

?
慕娘9325324

TA貢獻(xiàn)1783條經(jīng)驗(yàn) 獲得超4個(gè)贊

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML> 
<HEAD> 
<TITLE>New Document </TITLE> 
<META content="EditPlus" name="Generator"> 
<META content="" name="Author"> 
<META content="" name="Keywords"> 
<META content="" name="Description"> 
<script language="javascript"> 
<!-- 
function openChild(){ 
var aa = document.getElementById("txt9").value; 
var k = window.showModalDialog("child.html",aa,"dialogWidth:335px;status:no;dialogHeight:300px"); 
if(k != null) 
document.getElementById("txt11").value = k; 

//--> 
</script> 
</HEAD> 
<BODY> 
<FONT face="宋體"></FONT> 
<br> 
傳遞到父窗口的值:<input id="txt9" type="text" value="33333" name="txt9"><br> 
返回的值:<input id="txt11" type="text" name="txt11"><br> 
子窗口設(shè)置的值:<input id="txt10" type="text" name="txt10"><br> 
<input id="Button1" onclick="openChild()" type="button" value="openChild" name="Button1"> 
</BODY> 

</HTML> 

child.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML> 
<HEAD> 
<TITLE>New Document </TITLE> 
<META content="EditPlus" name="Generator"> 
<META content="" name="Author"> 
<META content="" name="Keywords"> 
<META content="" name="Description"> 
<meta http-equiv="Expires" content="0"> 
<meta http-equiv="Cache-Control" content="no-cache"> 
<meta http-equiv="Pragma" content="no-cache"> 
</HEAD> 
<BODY> 
<FONT face="宋體"></FONT> 
<br> 
父窗口傳遞來的值:<input id="txt0" type="text" name="txt0"><br> 
輸入要設(shè)置父窗口的值:<input id="txt1" type="text" name="txt1"><input id="Button1" onclick="setFather()" type="button" value="設(shè)置父窗口的值" name="Button1"><br> 
輸入返回的值:<input id="txt2" type="text" name="txt2"><input id="Button2" onclick="retrunValue()" type="button" value="關(guān)閉切返回值" name="Button2"> 
<input id="Button3" onclick="" type="button" value="關(guān)閉刷新父窗口" name="Button3"> 
<script language="javascript"> 
<!-- 
var k=window.dialogArguments; 
//獲得父窗口傳遞來的值 
if(k!=null) 

document.getElementById("txt0").value = k.document.getElementById("txt9").value; 

//設(shè)置父窗口的值 
function setFather() 

k.document.getElementById("txt10").value = document.getElementById("txt1").value 

//設(shè)置返回到父窗口的值 
function retrunValue() 

var s = document.getElementById("txt2").value; 
alert(s);
window.returnValue=s; 
window.close(); 

//--> 
</script> 
</BODY> 
</HTML>


查看完整回答
反對 回復(fù) 2022-12-21
?
慕尼黑的夜晚無繁華

TA貢獻(xiàn)1864條經(jīng)驗(yàn) 獲得超6個(gè)贊

直接使用js的函數(shù)
簡單介紹一下JavaScript alert()函數(shù)的使用,alert--彈出消息對話框,并且alert消息對話框通常用于一些對用戶的提示信息。
  JavaScript alert()函數(shù)
  alert--彈出消息對話框(對話框中有一個(gè)OK按鈕)
  alert,中文"提醒"的意思
  alert函數(shù)語法
  alert(str);
  alert函數(shù)提示框圖示
  
  alert函數(shù)參數(shù)
  str--要顯示在消息對話框中的文本
  alert函數(shù)說明
  alert消息對話框通常用于一些對用戶的提示信息,例如在表單中輸入了錯(cuò)誤的數(shù)據(jù)時(shí)。
  提示:消息對話框是由系統(tǒng)提供的,因此樣式字體在不同瀏覽器中可能不同。
  提示:消息對話框是排它的,也就是在用戶點(diǎn)擊對話框的按鈕前,不能進(jìn)行任何其它操作。
  提示:消息對話框通??梢杂糜谡{(diào)試程序。
  示例

alert("Hellodreamdu!"); alert('Welcometo<br/>dreamdu!'); alert('Welcometo\ndreamdu!');  

  注意上面的第二個(gè)與第三個(gè)例子,只有第三個(gè)例子才能實(shí)現(xiàn)換行,參考ASCII碼表,使用HTML中的br標(biāo)簽無法換行。


查看完整回答
反對 回復(fù) 2022-12-21
  • 2 回答
  • 0 關(guān)注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號