html head meta http-equiv=Content-Type content=text/html; charset=utf-8 / !-- 在页面上添加 Google的AJAX 语言 API,可以输入该地址下载该js api文件 -- script type=text/javascript src=http://www.google.com/jsapi/script scrip...
在做js返回顶部的效果时,要监听网页滚动条滚动事件,这个事件就是:window.onscroll。当onscroll事件发生时,用 js 获得页面的scrollTop值,判断scrollTop为一个设定值时,显示返回面部 js网...
定义和用法 split() 方法用于把一个字符串分割成字符串数组。 语法 stringObject.split(separator,howmany) 参数 描述 separator 必需。字符串或正则表达式,从该参数指定的地方分割 stringObject。 h...
$(div input).length// 结果就是得到div下的input标签的数量...
document.getElementById(test).href = http://www.baidu.com;...
select id=menu option value=1 测试1/option option value=2 测试2/option option value=3 测试3/option /select 设置值得方式:是将select中的任何一个 option 来设为默认值 $(function(){ $(#menuoption[value=3]).attr(select...
!DOCTYPE html html xmlns=http://www.w3.org/1999/xhtml head meta http-equiv=Content-Type content=text/html; charset=utf-8 / title/title script src=jquery-1.9.1.js/script script $(function () { var json = {url:http://bbs.moxun.pw,title:测试...
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。 type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和 delete也可以使用,...
方案一:script标签的async=async属性(详细参见:script标签的async属性) 点评:HTML5中新增的属性,Chrome、FF、IE9IE9+均支持(IE6~8不支持)。此外,这种方法不能保证脚本按顺序执行。 方案...
设置或获取对象指定的文件名或路径。 alert(window.location.pathname) 设置或获取整个 URL 为字符串。 alert(window.location.href); 设置或获取与 URL 关联的端口号码。 alert(window.location.port) 设置或获...