关于这段代码我想让他打开的时候就运行

xtdzqb 2009-08-13 10:10:58
1.我希望下面的这个MYDIV的JS代码能打开这个网站的时候就自动运行,需要怎么写?
2.如果我要设置成一天的第一次打开这个页面自动运行这个JS代码,这天的其他时间打开这个站不自动运行,又要怎么写?
在线等……
=================================================================

JScript code

<!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" lang="en" xml:lang="en"> <head> <title>Facebox Demo</title> <script src="facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script> <link href="facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" /> <script src="facefiles/facebox.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox() }) </script> </head> <body onload="#mydiv"> <p><a href="#mydiv" rel="facebox">View DIV with id="mydiv" on the page</a></p> <div id="mydiv" style="display:none"> <Iframe src="http://www.baidu.com" width="800" height="600" scrolling="no" frameborder="0"></iframe> <a href="http://newave.nbut.cn">Click here to go to Newave Studio</a> </div> </body> </html>

...全文
79 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
xzx99 2009-08-15
  • 打赏
  • 举报
回复
又学了一招.
xtdzqb 2009-08-15
  • 打赏
  • 举报
回复
2楼的代码是ASP的吧?
lanseshenying 2009-08-14
  • 打赏
  • 举报
回复
二楼的方法,可以,楼主把这段代码放到要显示DIV内容的部分就可以了。
wumeng53521 2009-08-14
  • 打赏
  • 举报
回复
加到onload事件里吧
xtdzqb 2009-08-14
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 number123456 的回复:]
HTML code<%if Request.Cookies("RunLog")<>""then%><%else
Response.Cookies("RunLog")="Run"
Response.Cookies("RunLog").Expires=DateAdd("d",1,Now())%><divid="mydiv"></div><%endif%>
[/Quote]

这个要插在哪里啊?
number123456 2009-08-14
  • 打赏
  • 举报
回复
<%if Request.Cookies("RunLog") <> "" then%>
<%
else
Response.Cookies("RunLog") = "Run"
Response.Cookies("RunLog").Expires = DateAdd("d", 1, Now())
%>
<div id="mydiv">
</div>
<%end if%>

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧