立诚勿怠,格物致知
It's all about connecting the dots

2015年07月的文章 第2页

evt and window.event in JavaScript

You may want to ask what "thisSquare" here means. A good question! You know, typically, a BINGO game is played on a 5 rows * 5 columns layout (therefore there are 25 cells in total). The above code is aimed to fetch the information that which cell is clicked by the mouse (so you now know "thisSquare" refers to the currently clicked cell). However, the meaning of "thisSquare" is not my concern. I paid much attention to the contents after the equality sign, i.e. "evt.target" and "window.event.srcElement".

JavaScript 阅读(1843)去评论赞(0)

Simplest Image Rollovers Effect Created by JavaScript

The above small code snippet is very simple, but with some problems and drawbacks:

  • Because the second image is downloaded from the server at the time the user rools over the first image, there can be a perceptible delay before the second image replaces the first one, especially for people browsing your site with a slower connection.
  • Using this method causes an error message in ancient browsers, such as Netscape 2.0 or earlier, Internet Explorer 3.0 or earlier, or the America Online 2.7 browser. Since there are so few of these vintage browsers still in use, it's not much of a problem these days.

JavaScript 阅读(1913)去评论赞(0)

Value Types in JavaScript

In JavaScript, a piece of information is a value. There are different kinds of values. The kind you're most familiar with are numbers. A string value is characters - such as a word or words - enclosed in quotes.

JavaScript 阅读(1619)去评论赞(0)

JavaScript Event Handlers

Events are actions that the user preforms while visiting your page. Submitting a form and moving a mouse over an image are two examples of events. JavaScript deals with events using commands called event handlers. An action by the user on the page triggers an event handler in your script. Some common JavaScript event handlers are listed in this post.

JavaScript 阅读(1621)去评论赞(0)

? in JavaScript

While reading JavaScript codes, you may find "?" operator in a high frequency.

(condition) ? truePart : falsePart; is rough equivalent of:

if (condition) {
    truePart;
}
else {
    falsePart;
}

JavaScript 阅读(1622)去评论赞(0)

离开普洛

临江仙(杨慎)

滚滚长江东逝水,浪花淘尽英雄。

是非成败砖头空。

青山依旧在,几度夕阳红。

白发渔樵江渚上,惯看秋月春风。

一壶浊酒喜相逢。

古今多少事,都付笑谈中。

个人日志 阅读(4625)去评论赞(0)

登录

找回密码

注册