ASP.NET+Ajax+Javascript实现页面定次刷新滚动内容
一、概述
Marquee:Html中滚屏控件,可以使包含在此标记中的内容进行各个方向,各种速度的滚动,因此在不考虑使用第三方控件的前提下,考虑使用Marquee+xmlhttp来实现定次更新页面中的滚动内容,此实现在IE6.0及以上版本测试通过,其他浏览器暂时未测试过。
Marquee中的onfinish事件:在给Marquee属性loop赋值后,完成这些次数时,会调用onfinish事件。
二、功能及特点
1、Javascript通过Microsoft的MSXML对象,动态获取后台数据库数据;
2、Javascript解析MSXML对象中的xml内容,整理为html后,显示给用户;
3、通过配置文件Config.xml中的参数,可以修改Marquee的滚动速度、每笔数据的滚动次数、延时、Marquee的高度、滚动方向、鼠标悬停是否定制滚动等。
三、前台Html
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrmClearance.aspx.cs" Inherits="DynamicShow_FrmClearance" %>
<!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 runat="server">
<title>定次滚动示例</title>
<link href="../DynamicShow/Css/StyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="marquee.js"></script>
</head>
<body>
<form id="FrmClearance" runat="server">
<table id="BodyStyle" border="0px" width="100%">
<tr>
<td style="text-align: center; vertical-align: middle; font-family: 楷体_GB2312; font-size: 35px;
color: #0A246A; font-weight: bold; height: 160px">
&nbs
相关文档:
Several programming languages implement a sprintf function, to output a formatted string. It originated from the C programming language, printf function. Its a string manipulation function.
This is limited sprintf Javascript implementation. Function returns a string formatted by the usual printf co ......
1. ==
Javascript有两组相等运算符,一组是==和!=,另一组是===和!==。前者只比较值的相等,后者除了值以外,还比较类型是否相同。
请尽量不要使用前一组,永远只使用===和!==。因为==默认会进行类型转换,规则十分难记。如果你不相信的话,请回答下面五个判断式的值是true还是false:
false == 'false'
false ......
Javascript的事件绑定主要有四种方法(一下在IE中运行正常,但不保证其他浏览器):
[注:onXXX为某一事件,fun为某一function,domId为某一DOM对象id,event类型见后边附录。]
1、在DOM中,直接用onXXX="fun();"进行绑定
2、在Javascript代码中用 DOM对象.onXXX=fun 进行绑定
3、用 DOM对象.attach ......
按钮式:
<INPUT name="pclog" type="button" value="GO" onClick="location.href='url'">
直接跳转式:
<script>window.location.href='url';</script>
<SCRIPT LANGUAGE="javascript">
<!--
window.open
('page.html' ......
下面都是个人理解以及查找的网上的资料,如有不对的地方请指正
This
this 始终指向调用它的对象 ,都没有对象调用时就指向window
另外就是this一般都是在function中,当不在function中的时候 一定是指向window的.
var a ='a';
alert(this.a); //出来的是a
alert(this.b); //undefined 因为还没定义 ......