請問怎么把prompt的返回值(網(wǎng)址)放到window.open中
var?mp=prompt('確定打開的網(wǎng)址:','http://idcbgp.cn'); if(mp!=null) { ????window.open('http://idcbgp.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no'); }
這個(gè)地方僅僅是把返回值用來判斷非空,要怎么把這個(gè)返回的字符串當(dāng)做是url來用呢
2016-12-23
window.open(mp,'width=400px,height=500px,menubar=no,toolbar=no');
這樣就行了啊,直接把prompt()的返回值作為open()的第一個(gè)參數(shù)
2016-12-23
我也想知道,不過我覺得直接使用==號(hào)好像就行吧,或者使用equals方法比較一下