javascript 实现分页条
function Paging(pageNum,pageSize,totalCount,skipCount,fuctionName,currentStyleName,currentUseLink,preText,nextText,firstText,lastText)
{
//debugger;
var returnValue = "";
var begin = 1;
var end = 1;
var totalpage = Math.floor(totalCount / pageSize);
if(totalCount % pageSize >0)
{
totalpage ++;
}
if(preText == null)
{
firstText = "prev";
}
if(nextText == null)
{
nextText = "next";
}
begin = pageNum - skipCount;
end = pageNum + skipCount;
if(begin <= 0)
{
end = end - begin +1;
begin = 1;
}
if(end > totalpage)
{
end = totalpage;
}
for(count = begin;count <= end;count ++)
{
if(currentUseLink)
{
if(count == pageNum)
{
returnValue += "<a class=\""+currentStyleName+"\" href=\"javascript:void(0);\" onclick=\""+fuctionName+"("+count.toString()+");\">"+co
相关文档:
1.delete 运算符
对象删除一个属性,或数组中删除一个元素。将无用的内容删除以节省空间。
delete expression
example:
var person = new Object();
person.sex = "male";
alert(person.sex);
delete person.sex;
alert(person.sex);
2. ‘,' 运算符
var a = 2;
......
1
、理解document.all
[]
从IE4开始IE的object
model才增加了document.all
[],来看看document.all
[]的Description:
Array
of all HTML tags in the document.Collection of all elements contained by the
object.
也就是说document.all
[]是文档中所有标签组成的一个数组变量,包括了文档对象中所� ......
CDATA 内部的所有东西都会被解析器忽略。
假如文本中包含了大量的 "<" 和 "&" 字符 - 就像编程代码中经常出现的情况一样 - 那么这个 XML 元素就可以被定义为一个 CDATA 部分。
CDATA 区段开始于 "<![CDATA[",结束于 "]]>":
<script type="text/javascript">
<![CDATA[
function compare(a,b ......
这两天开始写古代地图的GIS网站,说白了就是用古代地图的内容效仿山寨一下谷歌地图。
JS这东西很久没写了,有些概念也很模糊,导致完成分块拖动加载的功能就花了好多时间。
主要问题是出在拖动时对元素内容的动态修改上,总结下。
通过JS脚本动态修改DOM元素内容通常有两种方法:
1. 通过DOM标准接口创建元素
var new ......