求解求解,問什么沒有輸入網(wǎng)址的框?。。?/h1>
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function openWindow()
? ? {
? ? // 新窗口打開時彈出確認框,是否打開
? ? var open=confirm('你確定要打開一個窗口嗎');
? ? if(open==true)
? ? {
? ? ? ? var wangzhi=prompt("請輸入你的成績","http://idcbgp.cn");
? ? ? ? if(wangzhi!=null)
? ? ? ? {
? ? ? ? ? ? window.open(wangzhi,widt=400,height=500,menubar=no,toolbar=no);
? ? ? ? }
? ? }
? ? else
? ? {
? ? ? ? document.write("那你想干啥");
? ? }
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? }
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function openWindow()
? ? {
? ? // 新窗口打開時彈出確認框,是否打開
? ? var open=confirm('你確定要打開一個窗口嗎');
? ? if(open==true)
? ? {
? ? ? ? var wangzhi=prompt("請輸入你的成績","http://idcbgp.cn");
? ? ? ? if(wangzhi!=null)
? ? ? ? {
? ? ? ? ? ? window.open(wangzhi,widt=400,height=500,menubar=no,toolbar=no);
? ? ? ? }
? ? }
? ? else
? ? {
? ? ? ? document.write("那你想干啥");
? ? }
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? }
2016-09-12
function Wopen(){
// 新窗口打開時彈出確認框,是否打開
? ? var open=confirm('你確定要打開一個窗口嗎');
? ? if(open==true)
? ? {
? ? ? ? var wangzhi=prompt('請輸入你的網(wǎng)址','http://idcbgp.cn');
? ? ? ? if(wangzhi!=null)
? ? ? ? {
? ? ? ? ? ? window.open(wangzhi,'_blank','widt=400,height=500,menubar=no,toolbar=no');
? ? ? ? }
? ? }
? ? else
? ? {
? ? ? ? document.write("那你想干啥");
? ? }
? }?
這樣就可以了,你的輸入的標點符號不是英文狀態(tài)下輸入的;
window.open(wangzhi,widt=400,height=500,menubar=no,toolbar=no);這句話后面的沒有引號,widt拼寫錯誤,width
2016-09-11
var wangzhi = prompt("請輸入你的成績",“http://idcbgp.cn”);
這句里面的網(wǎng)址是輸入框中的默認內(nèi)容,不可能為空,你window.open();里面的wangzhi返回的是網(wǎng)址