关于JavaScript中的window.open方法。
今天下了Myeclipse,打算试试做jsp和Html然后写了如下测试代码;<!DOCTYPEhtml>WindowsDemo.html<metaname="keywor...
今天下了Myeclipse,打算试试做jsp和Html
然后写了如下测试代码;
<!DOCTYPE html>
WindowsDemo.html
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my
page">
<meta name="content-type" content="text/html;
charset=UTF-8">
<script>
function fun(thisurl){
window.open(thisurl,"页面标题","width=370,heigth=160,scrollbars=yes,resizeable=no");
}
</script> 展开
然后写了如下测试代码;
<!DOCTYPE html>
WindowsDemo.html
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my
page">
<meta name="content-type" content="text/html;
charset=UTF-8">
<script>
function fun(thisurl){
window.open(thisurl,"页面标题","width=370,heigth=160,scrollbars=yes,resizeable=no");
}
</script> 展开
2个回答
推荐于2016-03-22
展开全部
语法
open(URL, windowName, windowFeatures)
参数
URL
A string specifying the URL to open in the new window. See the Location object for a描述 of the URL components.
windowName
A string specifying the window name to use in the TARGET attribute of a FORM or A tag. windowName can contain only alphanumeric or underscore (_) characters.
windowFeatures
(Optional) A string containing a comma-separated list determining whether or not to create various standard window features. These options are described below.
windowName的参数取值为_blank,_self,_top,_parent,他们的含义与html中相同。
如:
<script language="javascript">
function backToIndex(){
window.open("../index.jsp","_parent");
}
</script>
<input type="submit" name="Submit" value="提交" onclick=” backToIndex();”>是不会响应的,这样就会响应:
<input type="button" name="Submit" value="提交" onclick=” backToIndex();”>
open(URL, windowName, windowFeatures)
参数
URL
A string specifying the URL to open in the new window. See the Location object for a描述 of the URL components.
windowName
A string specifying the window name to use in the TARGET attribute of a FORM or A tag. windowName can contain only alphanumeric or underscore (_) characters.
windowFeatures
(Optional) A string containing a comma-separated list determining whether or not to create various standard window features. These options are described below.
windowName的参数取值为_blank,_self,_top,_parent,他们的含义与html中相同。
如:
<script language="javascript">
function backToIndex(){
window.open("../index.jsp","_parent");
}
</script>
<input type="submit" name="Submit" value="提交" onclick=” backToIndex();”>是不会响应的,这样就会响应:
<input type="button" name="Submit" value="提交" onclick=” backToIndex();”>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询