1. 编写一段JavaScript代码,实现在当前页面加载完成后弹出一个宽高为640*480px的无工具栏、地址栏,但有
状态栏的浏览器窗口,并且弹出窗口在5秒钟后自动关闭。(10分)
2. 假设页面上有一个表单form1,包含如下元素:一个下拉框source,包括“File”,“DVD”两个选项,初始值
为“File”;一个文本域file_path,一个文本域dvd_label。 编写一段DHTML代码实现如下要求:当下拉框
source选定“File”时只显示文本域file_path,选定DVD时只显示dvd_label。(10分)
状态栏的浏览器窗口,并且弹出窗口在5秒钟后自动关闭。(10分)
2. 假设页面上有一个表单form1,包含如下元素:一个下拉框source,包括“File”,“DVD”两个选项,初始值
为“File”;一个文本域file_path,一个文本域dvd_label。 编写一段DHTML代码实现如下要求:当下拉框
source选定“File”时只显示文本域file_path,选定DVD时只显示dvd_label。(10分)
解决方案 »
- 怎么一次性读取大文本文件的数据而不分行读取?
- 大家好,我原来的服务器是有几个网站是IIS的,占用80端口,tomcat用的8080端口,现在如何使tomcat使用80端口,域名还能解析IIS上,IIS可
- 一步一步的教你安装JDK1.5.3和Tomcat5.5.9资料下载
- 杀java线程 Linux死机 请问能有什么原因
- 请问我下载什么编译器啊?????
- 语法错误的问题,求救了.
- 为什么con=DriverManager.getConnection("jdbc:odbc:shop","","");连接数据库会出现异常?
- JAVAMAIL程序执行错误,代码如下,解决一次性给分
- 如何解决response.sendRedirect(strDirPath)重定向的问题??
- 关于jsp中的文本框输入的东东怎样生成html页
- servlet编译出错!到底问题在哪?
- 遇到个需要用主键配置无主键表映射的问题
function open() {
var subWin = window.open ('page.html', 'newwindow', 'height=640, width=480, top=0,left=0,
toolbar=no,location=no, menubar=yes,status=yes');
setTimeout("close()",1000);
}function close() {
subWin.close();
}<body onload="open()">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>Insert title here</title>
<script type="text/javascript">
/**
* 第一题
*/
function runCode(value) { var winName = window.open('', "_blank", 'height=640,width=480,status=yes,toolbar=no,menubar=no,location=no');
winName.document.open('text/html', 'replace');
winName.document.write(value);
winName.document.close();
}/**
* 第一题
*/
function createCloseWindow() { var scriptHtml = "<html>";
scriptHtml += "<head>";
scriptHtml += "<script type='text/javascript'>";
scriptHtml += " setTimeout(function() {window.close();}, 5000);";
scriptHtml += "<\/script>";
scriptHtml += "<\/head>";
scriptHtml += "<\/html>"
runCode(scriptHtml);
}/**
* 第二题
*/
function changeSelect(selectTarget) {
if (selectTarget.selectedIndex == 0) {
document.getElementById('file_path').style.display = '';
document.getElementById('dvd_path').style.display = 'none';
} else {
document.getElementById('file_path').style.display = 'none';
document.getElementById('dvd_path').style.display = '';
}
}</script>
</head>
<body>
<input type="button" value="test" onclick="createCloseWindow();"><br />
<select onchange="changeSelect(this);">
<option>File</option>
<option>DVD</option>
</select>
<span id="file_path">file_path</span>
<span id="dvd_path" style="display:none;">dvd_path</span>
</body>
</html>