js无法向父窗口传值,Untitle.html与a。html可以获取,Untitle。html与ShowPart_interface.jsp无法获取,而a.html的代码就是ShowPart_Interface.jsp运行后产生的html,好难搞,哦 !
Untitled.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language=JavaScript type=text/JavaScript>
function clickss(){
window.open("http://124.161.95.82:8001/CNC/SearchPartInterface.unicom?partname=运行维护部","tt","width=400,height=300");
//window.open("a.htm","tt","width=400,height=300");
}</script>
<body><form id=f_form name=f_form method=post ><label>
<input type=text name=chinaunicom_id />
</label>
<a href="#" onclick="clickss()">
555</a></form>
</body>
</html>
Untitled.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language=JavaScript type=text/JavaScript>
function clickss(){
window.open("http://124.161.95.82:8001/CNC/SearchPartInterface.unicom?partname=运行维护部","tt","width=400,height=300");
//window.open("a.htm","tt","width=400,height=300");
}</script>
<body><form id=f_form name=f_form method=post ><label>
<input type=text name=chinaunicom_id />
</label>
<a href="#" onclick="clickss()">
555</a></form>
</body>
</html>
解决方案 »
- 怎样动态设置表单里button属性
- 按钮在FF,Chrome下点击和回车都没反应,急!急!急!
- (在线等,答案正确立刻结贴给分)向各位提问,javascript怎么改变循环输出的checkbox的状态
- 日期转成秒的函数?
- 如何执行?
- 怎么用js实现下图中的图片显示效果?求高人指点
- 一个 onmouseout 事件的问题(梅花雪)
- 急救!请问如何根据iframe里面页面显示的高度而使iframe自定义高度?----在线等啊
- 讨论两个问题,关于可编辑下拉框和onkeypress事件的
- 《javascript权威指南》和《javascript技术大全》选哪个?
- 一个简单js问题。。。
- MediaPlayer问题
ShowPart_Interface.jsp
[code=Java]
<%@ page language="java"pageEncoding="GB2312"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function clicksk(user_id){
alert("我要成功阿!我靠!");
opener.document.f_form.chinaunicom_id.value = user_id;
window.close();
}
function getHttpRequest() {
var httpRequest = false;
if (window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
if (httpRequest.overrideMimeType) {
httpRequest.overrideMimeType("text/xml");
}
} else {
if (window.ActiveXObject) {
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP ");
}
catch (e) {
}
}
}
}
return httpRequest;
}
var httpReq = new getHttpRequest();
function searchSuggest() {
if (httpReq.readyState == 4 || httpReq.readyState == 0) {
var search = document.getElementById("txtsearch").value;
if(search==""){
var ss = document.getElementById("search_suggest");
ss.style.display="none";
}else
{
var url="SearchNameInterface.unicom?search=" + search;
httpReq.open("get",url,true);
httpReq.setRequestHeader( "Content-Type", "text/html;charset=UTF-8" );
httpReq.onreadystatechange = handleSearchSuggest;
httpReq.send();
}
}
}
if (httpReq.readyState == 4) {
var ss = document.getElementById("search_suggest");
ss.style.display="";
//清空上次的搜索结果
ss.innerHTML="";
//以"\n"将返回的文本数据分割成数组
var str = httpReq.responseText.split("\n");
//循环数据,组织HTML代码
var suggest="";
for(var i=0;i<str.length-1;i++){
var test = str[i].split("|");
//alert('----'+str[i]);
suggest += "<div onmouseover='javascript:suggestOver(this);'"
suggest += " onmouseout='javascript:suggestOut(this);'";
suggest += " onclick='javascript:setSearch('test[0]');'";
suggest += " c1ass='suggest_link'>"+str[i]+"</div>";
}
suggest += "<div onmouseover='javascript:suggestOver(this);'"
suggest += " onmouseout='javascript:suggestOut(this);'";
suggest += " onclick='javascript:closeSearch();'";
suggest += " c1ass='suggest_link'>关闭</div>";
alert(suggest);
ss.innerHTML=suggest;
}
}//该方法改变鼠标移动到该选项时的CSS样式表
var suggestOver = function(div_value){
div_value.className="suggest_link_over";
}
//该方法改变鼠标移出选项时的CSS样式表
var suggestOut = function(div_value){
div_value.className="suggest_link";
}var setSearch = function(str){
//alert(str.indexOf(" "));
var obj = document.getElementById("txtsearch");
alert(str);
obj.value = str;
var ss =document.getElementById("search_suggest");
ss.style.display="none";
}var closeSearch = function(){
var ss =document.getElementById("search_suggest");
ss.style.display="none";
}
</script>
<style type="text/css" media="screen">
/*设置body样式表*/
body {
font:12px arial;
text-align: center;
background-image: url(Imgs/left.jpg);
margin-left: 0px;
margin-top: 0px;
}
/*设置提示连接的样式表*/
.suggest_link {
font-size:12px;
background-color: #cde5ff;
padding: 2px 6px 2px 6px;
}
/*设置当鼠标移动到提示上的样式表*/
.suggest_link_over {
font-size:12px;
background-color: red;
padding: 2px 6px 2px 6px;
}
/*设置显示搜索提示div的样式表*/
#search_suggest {
position: inherit;
background-color:#cde5ff;
text-align:left;
border:0px solid #000000;
width:300px;
}
.div1 {
border-left:dashed;
border-right:dashed;
border-top:dashed;
position: absolute;
top:0px;
left:0;
margin:0px auto 0 auto ;
width:400px;
height:30px;
overflow:hidden;
}
.div2 {
border-left:dashed; border-bottom:dashed;
position: absolute;
top:30px;
left:0px;
margin:0px auto 0 auto 0px auto 0 auto;
width:188px;
height:270px;
overflow:auto;
}
.div3 {
border-right:dashed; border-bottom:dashed;
position: absolute;
top:30px;
left:188px;
margin:0px auto 0 auto;
width:212px;
height:270px;
overflow:auto;
font-size:12px;
}
.div4 {
position: absolute;
top:30px;
left:50px;
margin:0px auto 0 auto;
width:300px;
overflow:auto;
}
.STYLE1 {
color: #FF0000;
font-weight: bold;
}
</style>
<LINK REL="StyleSheet" HREF="Manager/dtree.css" TYPE="text/css" />
<SCRIPT TYPE="text/javascript" >
str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"'; if (node.title) str += ' title="' + node.title + '"'; if (node.target) str += ' target="' + node.target + '"'; if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" '; if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"'; str += '>'; } else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id) str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
str += node.name; if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>'; str += '</div>';
if (node._hc) { str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">'; str += this.addNode(node); str += '</div>'; } this.aIndent.pop(); return str;};// Adds the empty and line iconsdTree.prototype.indent = function(node, nodeId) { var str = ''; if (this.root.id != node.pid) { for (var n=0; n<this.aIndent.length; n++) str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />'; (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); if (node._hc) { str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="'; if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus; else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) ); str += '" alt="" /></a>'; } else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />'; } return str;};