javascriptÖÐFORM±íµ¥µÄsubmit()·½·¨¾Ñé½Ìѵ
@author songfeng
ÒòΪJSÄÚ¶ÔÏóµÄ·½·¨Êµ¼ÊÉÏÊÇ´æ´¢Óï¾äµÄÒ»¸öÀàËÆÓÚÖ¸ÕëµÄ¶«Î÷. ÆäÖ¸ÏòÁËÄÚ´æµÄÒ»¸öλÖÃ, Ò²¾ÍÊÇÆäº¯ÊýµÄλÖÃ,µ±È»Ò²¿ÉÒÔÈÃÆäÖ¸ÏòÒ»¸ö±äÁ¿Öµ.
var foo = new Object();
foo.bar = function() {} //ÏÖÔÚfoo.bar¾ÍÊÇÖ¸ÏòÁËÕâ¸öº¯ÊýµÄÄÚ´æÎ»ÖÃ.
foo.bar = "abcdefg"; //ÏÖÔÚÆäÖ¸ÏòÁËÄÚ´æÖеÄ×Ö·û´®
Ò²¾ÍÊÇ˵ËüÃǵÄÃû×ÓÊÇÒ»ÑùµÄ, µÚ¶þ¸ö»á°ÑµÚÒ»¸ö¸²¸Çµô, ²¢²»»áÓÐÈκÎÌáʾ.
ÏÂÃæÊÇÎÒ½ñÌìÓöµ½µÄÎÊÌâ.
<form action="" name="applyForm" namemethod="post">
<input type="text" name="foo" value="" />
<input type="button" id="submit" onClick="apply();" name="submit"
/> //×¢ÒâËüµÄname
</form>
<script>
function apply()
{
document.applyForm.submit()
;
}
</script>
apply()¾ÍÊÇÎÞ·¨Ìá½», ×ÜÊǸæËßÎÒsubmit()²»ÊÇ·½·¨, ¿ÉÊÇÃ÷Ã÷Æä¾ÍÊÇÒ»¸ö·½·¨.
ºóÀ´×Ðϸ¼ì²é(ÒòΪԴ´úÂë±ÈÕⳤºÜ¶à), ²ÅÕÒ³öÎÊÌâËùÔÚ. ÔÀ´ÊÇinput±íµ¥µÄnameÖµÊÇsubmit, ËüÀíËùµ±È»µÄ³ÉÁË´ËFORM
µÄÊôÐÔÖµ.×ÔÈ»¾Í°ÑÒÔǰµÄ¶¥ÌæÁË. ¸Äºó, ÔòÕý³£ÔËÐÐ.
Ïà¹ØÎĵµ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript</t ......
ÀûÓÃjsÀ´¶¯Ì¬´´½¨±í¸ñÓÐÁ½ÖÖ¸ñʽ£¬appendChild()ºÍinsertRow¡¢insertCell()¡£Á½ÖÖ·½Ê½Æäʵ²î²»¶à£¬µ«µÚÒ»ÖÖÓпÉÄÜÔÚIEÉÏÓÐÎÊÌ⣬ËùÒÔÍÆ¼ö´ó¼ÒʹÓõڶþÖÖÁË£¬Ö±½Ó˵°É¡£
1¡¢inserRow()ºÍinsertCell()º¯Êý
insertRow()º¯Êý¿ÉÒÔ´ø²ÎÊý£¬ÐÎʽÈçÏ£º
insertRow(index)£ºindex´Ó0¿ªÊ¼
¡¡¡¡Õâ¸öº¯Êý½«ÐÂÐÐÌí¼Óµ½indexµÄÄÇÒ»ÐÐÇ ......
Optimizing JavaScript code
Authors: Gregory Baker, Software Engineer on GMail & Erik Arvidsson, Software Engineer on Google Chrome
Recommended experience: Working knowledge of JavaScript
Client-side
scripting can make your application dynamic and active, but the
browser's interpretation o ......
$wnd and $doc Calling native JavaScript with JSNI
$wnd ÊÇʲô£¿
GWT provides the $wnd and $doc variables to refer to the window and document objects
GWTʹÓÃͨ¹ýJava Native methodʹÓÃËü£¬ÉùÃ÷Ò»¸önative·½·¨£¬½«º¬ÓÐJavaScriptµÄ·½·¨Ìå×¢ÊÍ¡£±àÒëÆ÷½«×¢ÊÍ¿éÄÚµÄÄÚÈÝÖð×ÖÊä³ö£¬Ê¹Ö®Óë±àÒë²úÉúµÄJavaScriptÕûº ......
Although the days of long and tedious code branches to target specific browsers in JavaScript are over, once in a while it's still necessary to do some simple code branching and object detection to ensure that a certain piece of code is working properly on a user's machine.
In this article, I ......