请看这里:http://www.jsshow.com/data/view.asp?id=913
我把这里的代码弄下来了可弄好了就是死活插不了表格进去问题就出在上面所说那里的
我把这里的代码弄下来了可弄好了就是死活插不了表格进去问题就出在上面所说那里的
解决方案 »
- 大家用什么jQuery消息提示插件,能使消息tips自动调整位置一直在某个自定义的容器内?
- 自己写了个选择器,感觉非常的非主流……
- JavaScript很怪异的写法!
- 怎样用正则提取<title> </title>之间的内容?
- 求一个CSS+DIV制作的链接背景变化源码
- 救教能否用javascript仿windows的启动屏保功能
- 急!!! 转换成UTF8后出现"未结束的字符串常量".
- 菜鸟有问题了 javascript与XML
- 这段代码里的#是什么意思?
- iframe的onkeypress事件?
- 急~~急~~急!我的QQ试菜单不能在浏览窗口里显示出来,还请各位大虾帮忙改正,谢谢!
- 请问一下:IE里发送电子邮件页面用javascript调用的CLSID是多少啊?
=-===================
test.htm
======================<script>
function selcolor(strCaller,URLToOpen){
var temp = window.showModalDialog(URLToOpen,strCaller,'dialogWidth:18.5em; dialogHeight:17.5em;help:0;status:0;resizable:0;center:1')
if( temp == "undefined" || temp == null || temp == "" )
temp = strCaller;
if( temp == "#NaNNaNNaN" ) temp = ""
return temp;
}
</script><form>
<input name="selectcolor">
<input type="button" value="选择颜色" onclick="JavaScript:var strCaller = selectcolor.value;var thisValue = selcolor(strCaller,'setColor.htm');selectcolor.value = thisValue;">
</form>
========== setColor.htm ==================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>颜色</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE type=text/css>
TD { FONT-SIZE: 10.8pt}
BODY { FONT-SIZE: 10.8pt}
BUTTON {WIDTH: 5em}
</STYLE><SCRIPT language=JavaScript>
var SelRGB = '';
var DrRGB = '';
var SelGRAY = '120';
var temp;
var hexch = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');function ToHex(n)
{ var h, l; n = Math.round(n);
l = n % 16;
h = Math.floor((n / 16)) % 16;
return (hexch[h] + hexch[l]);
}function DoColor(c, l)
{ var r, g, b; r = '0x' + c.substring(1, 3);
g = '0x' + c.substring(3, 5);
b = '0x' + c.substring(5, 7);
if(l > 120)
{
l = l - 120; r = (r * (120 - l) + 255 * l) / 120;
g = (g * (120 - l) + 255 * l) / 120;
b = (b * (120 - l) + 255 * l) / 120;
}else
{
r = (r * l) / 120;
g = (g * l) / 120;
b = (b * l) / 120;
} return '#' + ToHex(r) + ToHex(g) + ToHex(b);
}function EndColor()
{ var i; if(DrRGB != SelRGB)
{
DrRGB = SelRGB;
for(i = 0; i <= 30; i ++)
GrayTable.rows(i).bgColor = DoColor(SelRGB, 240 - i * 8);
} SelColor.value = DoColor(RGB.innerText, GRAY.innerText);
ShowColor.bgColor = SelColor.value;
}
</SCRIPT><SCRIPT event=onclick for=ColorTable language=JavaScript>
SelRGB = event.srcElement.bgColor;
EndColor();
</SCRIPT><SCRIPT event=onmouseover for=ColorTable language=JavaScript>
RGB.innerText = event.srcElement.bgColor;
EndColor();
</SCRIPT><SCRIPT event=onmouseout for=ColorTable language=JavaScript>
RGB.innerText = SelRGB;
EndColor();
</SCRIPT><SCRIPT event=onclick for=GrayTable language=JavaScript>
SelGRAY = event.srcElement.title;
EndColor();
</SCRIPT><SCRIPT event=onmouseover for=GrayTable language=JavaScript>
GRAY.innerText = event.srcElement.title;
EndColor();
</SCRIPT><SCRIPT event=onmouseout for=GrayTable language=JavaScript>
GRAY.innerText = SelGRAY;
EndColor();
</SCRIPT><SCRIPT event=onclick for=Ok language=JavaScript>
window.returnValue = SelColor.value;
window.close();
</SCRIPT>
</HEAD>
<BODY bgColor=menu>
<DIV align=center>
<CENTER>
<TABLE border=0 cellPadding=0 cellSpacing=10>
<TBODY>
<TR>
<TD>
<TABLE border=0 cellPadding=0 cellSpacing=0 id=ColorTable style="CURSOR: hand">
<SCRIPT language=JavaScript>
function wc(r, g, b, n)
{
r = ((r * 16 + r) * 3 * (15 - n) + 0x80 * n) / 15;
g = ((g * 16 + g) * 3 * (15 - n) + 0x80 * n) / 15;
b = ((b * 16 + b) * 3 * (15 - n) + 0x80 * n) / 15; document.write('<TD BGCOLOR=#' + ToHex(r) + ToHex(g) + ToHex(b) + ' height=8 width=8></TD>');
}var cnum = new Array(1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0); for(i = 0; i < 16; i ++)
{
document.write('<TR>');
for(j = 0; j < 30; j ++)
{
n1 = j % 5;
n2 = Math.floor(j / 5) * 3;
n3 = n2 + 3; wc((cnum[n3] * n1 + cnum[n2] * (5 - n1)),
(cnum[n3 + 1] * n1 + cnum[n2 + 1] * (5 - n1)),
(cnum[n3 + 2] * n1 + cnum[n2 + 2] * (5 - n1)), i);
} document.writeln('</TR>');
}
</SCRIPT> <TBODY></TBODY></TABLE></TD>
<TD>
<TABLE border=0 cellPadding=0 cellSpacing=0 id=GrayTable
style="CURSOR: hand">
<SCRIPT language=JavaScript>
for(i = 255; i >= 0; i -= 8.5)
document.write('<TR BGCOLOR=#' + ToHex(i) + ToHex(i) + ToHex(i) + '><TD TITLE=' + Math.floor(i * 16 / 17) + ' height=4 width=20></TD></TR>');
</SCRIPT><TBODY></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></DIV>
<DIV align=center>
<CENTER>
<TABLE border=0 cellPadding=0 cellSpacing=10>
<TBODY>
<TR>
<TD align=middle rowSpan=2>选中色彩
<TABLE border=1 cellPadding=0 cellSpacing=0 height=30 id=ShowColor
width=40>
<TBODY>
<TR>
<TD></TD></TR></TBODY></TABLE></TD>
<TD rowSpan=2>基色: <SPAN id=RGB></SPAN><BR>亮度: <SPAN
id=GRAY>120</SPAN><BR>代码: <INPUT id=SelColor size=7></TD>
<TD><BUTTON id=Ok type=button>确定</BUTTON></TD></TR>
<TR>
<TD><BUTTON onclick=window.close();>取消</BUTTON></TD></TR></TBODY></TABLE></CENTER></DIV></BODY></HTML>
//main.asp
function show_dialog2(src,viewtype)
{
//向dialog中传入单个参数
// var dialogArg="src"
//向dialog中传入一个数组参数
var dialogArg=new Array();
var the_url = "";
var the_winstate="";
var str;
str="dialogArg[0]=frm."+src+".value";
eval(str);
dialogArg[1]=viewtype;
the_url="editinfo.asp"; //定义dialog窗的页面URL
the_winstate="dialogWidth:500px;dialogHeight:400px;status:'no'"; //定义页面的大小风格
var result=showModalDialog(the_url,dialogArg,the_winstate);
if(typeof(result)!="undefined")
{
str="frm."+src+".value=result";
eval(str);
}
}///editinfo.asp
<textarea rows="20" cols="60" name="data" readonly>
//从页面中取得一个参数
//document.all("data").value=window.dialogArguments;
//从页面中取得数组参数
document.all("data").value=window.dialogArguments[0];
if(window.dialogArguments[1]=="edit")
{
document.all.data.readOnly=false;
}
else
{
document.all.save.style.display="none";
}
function checkdata()
{
var content=document.all("data").value
var len=CheckStrLen(content);
if(len>=2000)
{
alert("内容不能超过2000字节!")
}
else
{
//returnValue在页面中不能定义,否则返回undefined
returnValue=content; //赋返回值
window.close(); //关窗口
}
}
</script>
假如我“发表了文章”后,在里面的add_sql.asp里面request,怎么样才能得到那个编辑框里面的内容呢??谢谢
关键是这里。。我不知道怎么得到一个控件里面的内容。。
关键是这里。。我不知道怎么得到一个控件里面的内容。。
呵呵,我也迷惑啦
编辑页面:
<iframe class="Composition" ID="Composition" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="400" oncontextmenu="return false" scrolling="1">
下面的代码是在Composition所在页面开的一个新窗口:
<!--框架操作iframe-->
<script language=javascript>
str='<IMG alt="" src="'+'<%=tempfilename%>'+'" align=baseline border=0>';
//InitDocument();
//alert(str);
/*
将str直接加入到框架iframe的内容( opener.Composition.document.body.innerHTML)中会对str中的字串进行server.htmlencode操作,所以可以采用下面的方面将框架内容和str中的内容合并。 */
opener.parent.form1.content.value=opener.Composition.document.body.innerHTML+str;
//alert(opener.parent.form1.content.value);
opener.Composition.document.body.innerHTML=opener.parent.form1.content.value;
window.close();
opener.window.focus();
</script>我猜想你那里可以试试:
doc_html.innerhtml
应该可以取到编辑内容。
=================================
<SCRIPT LANGUAGE=JAVASCRIPT>
var myDialog = new Object;
function test() {
var temp;
temp = document.form1.u_name.value ;
myDialog.str = "";
result=showModalDialog("list_user.asp?name="+temp, myDialog,"status:no;scroll:yes;help:no;")
if (result==false)
return; // user canceled search
else {
document.form1.u_name.value = myDialog.str;
if (document.form1.u_name.value != "" && document.form1.u_name.value != " ")
document.form1.search1.checked = true;
}
}
</SCRIPT>
<form method="post" action="" name="form1" >
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" width="98%">
<tr>
<td width="100%" align="center" colspan="3">订单超级搜索</td>
</tr>
<tr>
<td width="19%" align="right"> </td>
<td width="81%" colspan="2">
<input type="text" name="u_name" readonly size="20"><input type="button" value="选择会员" onclick="test()" name="B3"></td>
</tr>
</table>
</div>
</form>
=====================================
<!--#include file="1.asp"-->
<HTML>
<HEAD><TITLE>选择会员</TITLE>
<SCRIPT LANGUAGE="JScript">
<!--
function doInit() {
if (window.dialogArguments != null) {
window.MySearch.value = window.dialogArguments.str;
}
window.returnValue = false;
}
function doOK() {
window.returnValue = true;
if (window.dialogArguments != null) {
window.dialogArguments.str = window.MySearch.value;
}
window.close();
}
function CA(name)
{
window.MySearch.value = name;
//alert(name);
doOK();
}
-->
</SCRIPT>
</HEAD>
<BODY onload="doInit()" >
<%
dim search,conn,rs
set conn=server.createobject("ADODB.Connection")
conn.Open driver_name2
Set rs = Server.CreateObject("ADODB.Recordset")
search="select * FROM p_user order by u_indate desc"
rs.Open search,conn,3,2
if rs.EOF then
response.write "<script language='javascript'>" & VbCRlf
response.write "alert('对不起,还没有任何会员信息!');" & VbCrlf
'response.write "history.go(-1);" & vbCrlf
response.write "</script>" & VbCRLF
Response.Write "<p align=center><font color=red>不好意思,还没有 会员!</font>"
response.end
else%>
<form action="list_user.asp?mode=doit" method=post name=form1>
<p align="center"><font color=red>选择会员-->所有会员列表</font> <a href="#" onclick="javascript:window.close();" ><font color=blue>取消退出</font></a></p>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" width="95%">
<tr>
<td width="11%" align="center">选择</td>
<td width="21%" align="center">用户名</td>
<td width="15%" align="center">选择</td>
<td width="17%" align="center">用户名</td>
<td width="14%" align="center">选择</td>
<td width="17%" align="center">用户名</td>
</tr>
<%
do while (not rs.EOF )
%>
<tr>
<td width="11%" align="center"><font color="#008000">
<input onClick="javascript:CA('<%= rs("u_name")%>');" name="siteid" type="checkbox" value="<%= rs("u_id")%>"></font></td>
<td width="21%" align="center">
<%= rs("u_name")%>
</td>
<%
rs.MoveNext
if rs.EOF then
Response.Write "<td width=""15%"" align=""center""></td><td width=""17%"" align=""center""></td>"
Response.Write "<td width=""14%"" align=""center""></td><td width=""17%"" align=""center""></td>"
exit do
end if
%>
<td width="15%" align="center"><font color="#008000"><input onClick="javascript:CA('<%= rs("u_name")%>');" name="siteid" type="checkbox" value="<%= rs("u_id")%>"></font></td>
<td width="17%" align="center">
<%= rs("u_name")%>
</td>
<%
rs.MoveNext
if rs.EOF then
Response.Write "<td width=""14%"" align=""center""> </td><td width=""17%"" align=""center""> </td>"
exit do
end if
%>
<td width="14%" align="center"><font color="#008000"><input onClick="javascript:CA('<%= rs("u_name")%>');" name="siteid" type="checkbox" value="<%= rs("u_id")%>"></font></td>
<td width="17%" align="center">
<%= rs("u_name")%>
</td>
</tr>
<%
rs.MoveNext
loop
%>
</table>
</center>
</div>
</form>
<%
end if
%>
<INPUT ID=MySearch TYPE=hidden >
</BODY>
</HTML>
var newMenuItem=new Array()
newMenuItem[0]=0
newMenuItem[1]=menuOne
retval = window.showModalDialog("/ltiface.nsf/addMenuItem?openform",newMenuItem,dialogProperty1);通过window.dialogArguments访问传入的参数。
var ss = showModalDialog("dia.htm","test");
</script>dia.htm(对话框)<script>
alert(window.dialogArguments);
</script>