摘要: window对象位于BOM层次结构的最顶层。它包含了一些非常重要的子对象,包括location,navigator,document,screen,history。location对象包含当前页面的URL信息。有些信息是只读的,有些信息是可以读写的比如href属性。我们不仅可以通过href属性来获取当前页面的URL信息,还可以通过修改href属性,来跳转到新的页面。<html> <body> <script type='text/javaScript'> window.location.replace("http://www.bai 阅读全文
posted @ 2012-07-11 17:41 TBHacker 阅读(1940) 评论(0) 推荐(0) 编辑
摘要: <html> <head> <script type='text/javascript'> var imagesArray=new Array("images/1.jpg","images/2.jpg","images/3.jpg","images/4.jpg"); function changeImg(imageNumber){ var newImage = imagesArray[Math.round(Math.random()*3)]; while(docu 阅读全文
posted @ 2012-07-11 16:35 TBHacker 阅读(637) 评论(0) 推荐(0) 编辑
摘要: return可以接受函数中的返回值,前提是函数中要有return语句。下面是一个应用小示例:<html> <head> <script type='text/javascript'> function linkPage(){ alert('You Clicked??'); return false; } </script> </head> <body> <A href='http://www.baidu.com' n... 阅读全文
posted @ 2012-07-11 15:35 TBHacker 阅读(330) 评论(0) 推荐(0) 编辑
摘要: <script type='text/javascript'>//构建一个CustomerBooking类//构造函数 function CustomerBooking(bookingId,customerName,film,showDate){ this.bookingId = bookingId; this.customerName = customerName; this.film = film; this.showDate =showDate; }//getBooking... 阅读全文
posted @ 2012-07-11 11:57 TBHacker 阅读(267) 评论(0) 推荐(0) 编辑