JavaScript in 10 Steps or Less
ûÓа´±ðÈ˵ÄÍÆ¼ö£¬Ñ§Ê²Ã´Ê¥¾ÀàµÄjsÊ飬¶øÊÇËæ±ãÌôÁ˱¾¡¶JavaScript in 10 Steps or Less¡·¡£
»¨ÁË3¸öСʱ£¬¿´ÁË30¸ötask¡£
½²µÄ·Ç³£Ç³ÏÔÏêϸ¡£ËäÈ»ÊÇEÎÄ£¬µ«ºÜdzÏÔÒ×¶®¡£
task31:
Calling Functions from Tags
One of the benefits of JavaScript is to be able to tie interactivity to elements of the HTML page. One way you can do this is to set up links in HTML that actually trigger calls to JavaScript functions when the link is clicked.
There are two ways to do this:
1. Use the onClick attribute of the a tag to call the function:
<a href=”#” onClick=”functionName()”>Link text</a>
2. Use a javascript: URL in the href attribute of the a tag to call
the function:
<a href=”javascript:functionName()”>Link text</a>
The following task illustrates these two methods of calling a function from a link by creating a function that displays an alert dialog box to the user and then providing two separate links for the user to use to call the function:
1. Open a new HTML document in your preferred HTML or text editor.
2. Create the header of the document with opening and closing head tags:
<head>
</head>
3. Insert a script block in the header of the document:
<script language=”JavaScript”>
<!--
// -->
</script>
4. Create a function named hello that takes no arguments:
function hello() {
}
5. In the function, use the window.alert method to display an alert
dialog box:
window.alert(“Hello”);
6. Create the body of the document with opening and closing body tags.
7. In the final page create two links that call the hello function using
onClick and the javascript: URL techniques so that the final
page looks like Listing 31-1.
<head>
<script language=”JavaScript”>
<!--
function hello() {
window.alert(“Hello”);
}
// -->
</script>
</head>
<body>
<a href=”#” onClick=”hello()
Ïà¹ØÎĵµ£º
JavaScript API
One of the new features we added to the ASP.Net Report Viewer in Visual Studio 2010 is a JavaScript API to allow you to interact with the viewer on client. In reading many of the posts on the report controls forum, we found that many people struggle when implementing a custom ......
http://bei123wang.blog.163.com/blog/static/23175492009113022048840/
JavaScript ¶ÔÏó×ÖÃæÁ¿
javascript 2009-12-30 14:20:48 ÔĶÁ7 ÆÀÂÛ0 ×ֺţº´óÖÐС
JavaScript ¶ÔÏó×ÖÃæÁ¿
ÔÚ±à³ÌÓïÑÔÖУ¬×ÖÃæÁ¿ÊÇÒ»ÖÖ±íʾֵµÄ¼Ç·¨¡£ÀýÈ磬"Hello, World!" ÔÚÐí¶àÓïÑÔÖж¼±íʾһ¸ö×Ö·û´®×ÖÃæÁ¿£¨string literal £©£¬JavaScript ......
Ò»¡¢Ä¬ÈϺ¯Êý
JavaScriptÌṩÁËһЩĬÈϵĺ¯Êý
±àÂ뺯Êýescape()£º½«·Ç×Öĸ¡¢Êý×Ö×Ö·ûת»»³ÉASCIIÂë
ÒëÂ뺯Êýunescape()£º½«ASCIIÂëת»»³É×Öĸ¡¢Êý×Ö×Ö·û
ÇóÖµº¯Êýeval()
ÊýÖµÅжϺ¯ÊýisNaN()£ºÅжÏÒ»¸öÖµÊÇ·ñΪ·ÇÊýÖµÀàÐÍ
ÕûÊýת»»º¯ÊýparseInt()£º½«²»Í¬½øÖÆ£¨¶þ¡¢°Ë¡¢Ê®Áù½øÖÆ£©µÄÊýֵת»»³ÉÊ®½øÖ ......
ÕýÔò±í´ïʽÊÇÒ»¸öÃèÊö×Ö·ûģʽµÄ¶ÔÏó¡£
JavaScriptµÄRegExp¶ÔÏóºÍString¶ÔÏó¶¨ÒåÁËʹÓÃÕýÔò±í´ïʽÀ´Ö´ÐÐÇ¿´óµÄģʽƥÅäºÍÎı¾¼ìË÷ÓëÌæ»»º¯ÊýµÄ·½·¨.
'***********************
' \\JavaScript//
'
'***********************
ÔÚJavaSc ......
Technorati ±êÇ©: µçÄÔÏà¹Ø
ÔÎĵØÖ·£ºhttp://www.playes.net/Blog/535.asp
IE ä¯ÀÀÆ÷µÄ½Å±¾Ê§Ð§ÊǸöÔ´Ô¶Á÷³¤µÄÎÊÌâÁË£¬ÓÐʱײÉÏÁËÄÇÒ²Ö»Äܹé½áÓÚÔµ·Ö£¬ÍêȫûµÃ½âÊÍ¡£Õâ´Î±¾È˾ÍÊÇÖдó²ÊµÄÔµ·Ö£¬±»Ð¡Ð¡µØ×²ÁËÒ»ÏÂÑü¡£
µ±È»½Å±¾Ê§Ð§Ò²ÓÐÇáÖØ£¬ÓÐʱÊÇÒ³ÃæÈ«²¿ÀÃɹ£¬Í¼Æ¬ÎÄ×ÖÈ«²¿ÏÔʾ´í룬²Ò²»È̶ã¬Æäʵ»µµÄÕâô³¹µ×·´ ......