动态添加javascript 从页面获取到值,在插入数据库的时候也添加进一张写好的javascript页面中,方便以后调用,修改同样,高手速度来起,有源码最好。就像网站的广告版位JS代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就把 js 文件当普通文件,按目标功能 javascript 代码格式输出 问题貌似不是很难吧,主要就是JS那边该怎么写参数,页面插入数据库的时候怎么把值丢进去,相对应的值,就以广告版位为例,广告版位现在有2种,1,弹出窗口 2,漂浮窗口 弹出:JS那边怎么搞 javascript页面是什么东西,楼主说清楚点,举例说下,不然大家看不明白!!! 现在我的目标就是怎么做这张弹出窗口的模板(如:弹出窗口.js(还没值只是参数)),传进来值后,创建成另外的JS页面(如:1.js),以后调用1.js 里面已经有值了 比如高度:200 宽度:200 创建时添的值 <a href="http://www.baidu.com" onmousemove="openwin()">弹出</a><script language="javascript"> function openwin() {openwindow=window.open("", "newwin", "height=250, width=250,resizable=no"); openwindow.document.write("<title>例子</title>") openwindow.document.write("<body bgcolor=#ffffff") openwindow.document.write("<h1>例子</h1>") openwindow.document.write("弹出窗口") openwindow.document.write("</body>") openwindow.document.write("</html>") openwindow.document.close()} 弹出窗口的例子 宽度 高度 BearRui(开心熊 | 来地球抢分) ( ) 信誉:110 2007-08-06 11:22:07 得分: 0 你的意思是不是在插入数据库后跟着执行一段JS函数 ====================== JS模板需要怎么写````然后就是传值 写好的javascript页做成固定的,非模板!添加或修改的时候以数据ID 命名为.js文件。.js文件里只保存如:var name=***;var pass=***;......以后调用,就只传ID 给写好的javascript页,写好的javascript页通过传入的ID加载.js文件。写好的javascript页里就只是界面和其他javascript动作了,这样保存的东西少了,修改起来也方便多了。不知道我是否理解了楼主的意图?!! dingsongtao(一翁傾塵『舍得』) ( ) 信誉:100 2007-08-06 12:24:32 得分: 0 写好的javascript页做成固定的,非模板!添加或修改的时候以数据ID 命名为.js文件。.js文件里只保存如:var name=***;var pass=***;......以后调用,就只传ID 给写好的javascript页,写好的javascript页通过传入的ID加载.js文件。写好的javascript页里就只是界面和其他javascript动作了,这样保存的东西少了,修改起来也方便多了。不知道我是否理解了楼主的意图?!! ====================刚才吃饭去了,才回来, 写好的javascript 里面就是传来的值(动作)应该没界面吧``就全是动作 ,相当于广告版位,版位参数:弹出窗口,宽度,高度,==。然后加载时版位的参数这个时候就该显示出来了,意思差不多了吧`` dingsongtao(一翁傾塵『舍得』) ---------意思差不多就是这样 你写一段有值 的js 代码,然后在cs 里整成字符串,再然后把值替换成用户输入的值,存入数据库 wuxing2006(金宝) ( ) 信誉:95 2007-08-06 14:30:55 得分: 0 你写一段有值 的js 代码,然后在cs 里整成字符串,再然后把值替换成用户输入的值,存入数据库 =====================没看懂```有没得点详细代码描述,我现在写了例子以他来说明 OK?function openwin() {openwindow=window.open("", "newwin", "height="+height+", width="+width+""); openwindow.document.write("<title>示例</title>") openwindow.document.write("<body bgcolor='red'") openwindow.document.write("<h1>示例</h1>") openwindow.document.write(""+img+"") openwindow.document.write("</body>") openwindow.document.write("</html>") openwindow.document.close()} 用户输入的值:img,height,widthimg="<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>";height="200";width="400"; dingsongtao(一翁傾塵『舍得』) ( )=========以他说的,升成另外一张.js的文件,上面传的值后成为以下:function openwin() {openwindow=window.open("", "newwin", "height="200", width="400""); openwindow.document.write("<title>示例</title>") openwindow.document.write("<body bgcolor='red'") openwindow.document.write("<h1>示例</h1>") openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"") openwindow.document.write("</body>") openwindow.document.write("</html>") openwindow.document.close()}以后调就是这张了,如果原来的叫A.JS 那么现在生成的这就叫1.js名字根据实际来改到时,修改调用都是1.js了,具体怎么操作 各位高手指点 你的意思是不是这种。。function openwin(name,height,width) {openwindow=window.open("", name"height=height, width=width); //这里就是把传进来的值付给它openwindow.document.write("<title>示例</title>") openwindow.document.write("<body bgcolor='red'") openwindow.document.write("<h1>示例</h1>") openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"") openwindow.document.write("</body>") openwindow.document.write("</html>") openwindow.document.close()} StrangeUncle() ( ) 信誉:100 ============差不多就是这样,刚把原文件成功的复制到另外指定的地方,现在就差怎么把值传给复制走的文件里面,数据库存的文件路径就是复制走的,以后直接修改 现在就差怎么把值传给复制走的文件里面,数据库存的文件路径就是复制走的,以后直接修改这个没怎么看懂,你的意思是不是,如果你的意思要用以前的文件地方了。那么你从数据存里面查出来再付给那个你要变地址的对象就行了吧比如function openwin(name,height,width,XX)//多放一个XX来存放你的地址,你要用就把XX付给要改的地址 {openwindow=window.open("", name"height=height, width=width); //这里就是把传进来的值付给它openwindow.document.write("<title>示例</title>") openwindow.document.write("<body bgcolor='red'") openwindow.document.write("<h1>示例</h1>") openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"") openwindow.document.write("</body>") openwindow.document.write("</html>") openwindow.document.close()} 应该是插入数据库之前就该把文件复制出来(插入数据库的路径是复制出去的js文件路径比如是1.js 原来的是a.js),不用再去查询数据库了。那里面的几个参数就应该改成用户输入的值,最先的a.js还是不变,相当于是个模版了,1.js就生成function openwin(name,height,width) {openwindow=window.open("", name"200, 200);//将原来的width等改了openwindow.document.write("<title>示例</title>") openwindow.document.write("<body bgcolor='red'") openwindow.document.write("<h1>示例</h1>") openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"") openwindow.document.write("</body>") openwindow.document.write("</html>") openwindow.document.close()} 昆哥 貌似是我自己搞得复杂了,刚才问了组长,他给了我一个例子 也是读取的XML文件里面的内容,然后把修改了的文件复制到指定的路径,保存,完毕``我很郁闷 浪费了我一天的时间。丢分了 参与者都拿分 谁能帮我写一段js代码呀 求一个正则表达式 有人熟悉godaddy.com的服务器如何使用吗? 关于.net程序调用外部winform程序问题 Response.Redirect后面带查询字符串之后网址出现问题 VS2005中的treeview控件的样式如何定义成这样? 弱弱的问下关于数据控件的问题 模板列的删除数据问题??? js函数中调用另一函数中的数组,咋办? 请问:在使用表单身份验证的时候,怎么指定验证返回的页面(“ReturnUrl”)? 求一条SQL语句! 中文环境下的开发 英文环境出错 帮忙啊 急
弹出:JS那边怎么搞
<script language="javascript">
function openwin()
{
openwindow=window.open("", "newwin", "height=250, width=250,resizable=no");
openwindow.document.write("<title>例子</title>")
openwindow.document.write("<body bgcolor=#ffffff")
openwindow.document.write("<h1>例子</h1>")
openwindow.document.write("弹出窗口")
openwindow.document.write("</body>")
openwindow.document.write("</html>")
openwindow.document.close()
} 弹出窗口的例子 宽度 高度
你的意思是不是在插入数据库后跟着执行一段JS函数
======================
JS模板需要怎么写````然后就是传值
添加或修改的时候以数据ID 命名为.js文件。
.js文件里只保存如:
var name=***;
var pass=***;
......以后调用,就只传ID 给写好的javascript页,写好的javascript页通过传入的ID加载.js文件。
写好的javascript页里就只是界面和其他javascript动作了,这样保存的东西少了,修改起来也方便多了。不知道我是否理解了楼主的意图?!!
写好的javascript页做成固定的,非模板!
添加或修改的时候以数据ID 命名为.js文件。
.js文件里只保存如:
var name=***;
var pass=***;
......以后调用,就只传ID 给写好的javascript页,写好的javascript页通过传入的ID加载.js文件。
写好的javascript页里就只是界面和其他javascript动作了,这样保存的东西少了,修改起来也方便多了。不知道我是否理解了楼主的意图?!!
====================刚才吃饭去了,才回来, 写好的javascript 里面就是传来的值(动作)应该没界面吧``就全是动作 ,相当于广告版位,版位参数:弹出窗口,宽度,高度,==。然后加载时版位的参数这个时候就该显示出来了,意思差不多了吧``
意思差不多就是这样
你写一段有值 的js 代码,然后在cs 里整成字符串,再然后把值替换成用户输入的值,存入数据库
=====================
没看懂```有没得点详细代码描述,我现在写了例子以他来说明 OK?
function openwin()
{
openwindow=window.open("", "newwin", "height="+height+", width="+width+"");
openwindow.document.write("<title>示例</title>")
openwindow.document.write("<body bgcolor='red'")
openwindow.document.write("<h1>示例</h1>")
openwindow.document.write(""+img+"")
openwindow.document.write("</body>")
openwindow.document.write("</html>")
openwindow.document.close()
}
用户输入的值:img,height,width
img="<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>";
height="200";
width="400";
以他说的,升成另外一张.js的文件,上面传的值后成为以下:
function openwin()
{
openwindow=window.open("", "newwin", "height="200", width="400"");
openwindow.document.write("<title>示例</title>")
openwindow.document.write("<body bgcolor='red'")
openwindow.document.write("<h1>示例</h1>")
openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"")
openwindow.document.write("</body>")
openwindow.document.write("</html>")
openwindow.document.close()
}以后调就是这张了,如果原来的叫A.JS 那么现在生成的这就叫1.js名字根据实际来改到时,修改调用都是1.js了,具体怎么操作 各位高手指点
function openwin(name,height,width)
{
openwindow=window.open("", name"height=height, width=width); //这里就是把传进来的值付给它
openwindow.document.write("<title>示例</title>")
openwindow.document.write("<body bgcolor='red'")
openwindow.document.write("<h1>示例</h1>")
openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"")
openwindow.document.write("</body>")
openwindow.document.write("</html>")
openwindow.document.close()
}
这个没怎么看懂,你的意思是不是,如果你的意思要用以前的文件地方了。那么你从数据存里面查出来再付给那个你要变地址的对象就行了吧比如function openwin(name,height,width,XX)//多放一个XX来存放你的地址,你要用就把XX付给要改的地址
{
openwindow=window.open("", name"height=height, width=width); //这里就是把传进来的值付给它
openwindow.document.write("<title>示例</title>")
openwindow.document.write("<body bgcolor='red'")
openwindow.document.write("<h1>示例</h1>")
openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"")
openwindow.document.write("</body>")
openwindow.document.write("</html>")
openwindow.document.close()
}
那里面的几个参数就应该改成用户输入的值,最先的a.js还是不变,相当于是个模版了,1.js就生成
function openwin(name,height,width)
{
openwindow=window.open("", name"200, 200);//将原来的width等改了
openwindow.document.write("<title>示例</title>")
openwindow.document.write("<body bgcolor='red'")
openwindow.document.write("<h1>示例</h1>")
openwindow.document.write(""<a href='http://www.baidu.com' target='_blank'><img src='img/att_20070428184031359_Thu.jpg' alt='tupian' /></a>"")
openwindow.document.write("</body>")
openwindow.document.write("</html>")
openwindow.document.close()
}