• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
胡卫军
博客园    首页    新随笔    联系   管理    订阅  订阅

js jq 一些属性

$(document).ready(function () { }); window.onload=方法;页面加载完触发

var iWidth = 300; //窗口宽度                var iHeight = 200; //窗口高度                    var iTop = (window.screen.height - iHeight) / 2;                var iLeft = (window.screen.width - iWidth) / 2;                window.open(URL, 'newwindow', 'height=300,width=300,top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')  修改页面title document.title = "我的粉丝";

分割 split() 参数:字符 var Str="2,2,3,5,6,6"; var Array= Str.split(','); indexof 查询字符或字符串在字符串的位置,不存在则为-1 var str="Hello world!" document.write(str.indexOf("Hello") + "<br />") document.write(str.indexOf("World") + "<br />") document.write(str.indexOf("world")) 0 -1 6

jq获取父级元素  parent()

Js childNodes 所有子节点 parentNode 父节点

 

posted @ 2014-07-31 10:50  胡卫军  阅读(320)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3