javascript ×Ö·û ±È½ÏÎÊÌâ
var a="some";
var b="some";
ÔõôÅÐ¶Ï a ºÍ b ÊDz»ÊÇÏàµÈѽ£¬
(ÓÃ==ºÃÏñ²»ÐÐ)
if (a!=b)
alert("×Ö·û²»·û")
else
alert("×Ö·ûÏàͬ")
if(a==b)¿ÉÒÔÓÃ"=="ºÅÅÐ¶ÏµÄ .
ÎÒÕâÓÃ==²»ÐУ¬ÊÇʲôÔÒòѽ£¬
JScript code:
function test(){
a = "some";
b = "some";
if(a==b){
alert("ÏàµÈ");
}
}
HTML code:
<input type="button" value="²âÊÔ" onclick="test()" />
JScript code:
<script>
var a="some";
var b="some";
if (a==b)
alert("×Ö·ûÏàͬ");
else
alert("×Ö·û²»·û");
</script>
ÎÒÊÔ¹ý£¬¿ÉÒÔ
Äã°Ñ½Å±¾µ÷ÊÔ¿ª¿ª£¬¿´¿´ÊÇʲôÔÒò
JScript code:
function test(){
if($("#text").val()=="some"){//Èç¹ûÊÇÎı¾¿òÅжÏ×Ö·ûÒª¼Ó""
alert("ÏàµÈ");
}else alert("²»ÏàµÈ
Ïà¹ØÎÊ´ð£º
ÈçÓÐÒ»¸ötextbox£¬Óû§ÊäÈëºóµãbutton°´Å¥Ê±£¬ÊµÏÖÓÃJavaScript¶ÔtextboxÊäÈëÐÅÏ¢µÄÑéÖ¤£¬ÒªÇóÓÃJavaScriptÀ´ÊµÏÖ£¬±ÈÈçÑéÖ¤Óû§ÊäÈëµÄÊÇ·ñÊÇÊý×Ö¡£
Ï£Íû½«HTML´úÂëÒ»²¢Ð´³öÀ´¹þ£¬Ð»Ð»
HTML code:
<!DOC ......
ÎÒÔÚ¹¤×÷ÖÐÓöµ½ÁËһЩÎÊÌ⣬¾ÍÊÇÔÚhtmlÎļþµ÷ÓÃjavascriptºÃÓ㬿ÉÊÇÓÃ.net µ÷ÓÃJS¾Í²»ºÃÓã¬ÕÒÁ˺ܶà×ÊÁÏ£¬µ«ÊÇ»¹²»ºÃÓá£ÏÖÔÚÇó´ó¼ÒÓÐûÓÐʲôºÃµÄÎÄÕ»òºÃµÄÊé½éÉÜһϣ¬ÈÃÎҺúÃѧϰһÏÂ.net¶ÔJSµÄ²Ù×÷¡£Ð»Ð»´ó¼ ......
Õâ¸ö±íµ¥µÄÊýÖµ²»Êǹ̶¨µÄ£¡µ±°´ÏÂÍ£Ö¹°´Å¥µÄʱºò×îÖÕµÄÊý×ֲŻáÍ£ÔÚÉÏÃæ£¡
ÎÒÏë°Ñ×îºóͣϵÄÊý×Ö´«ËÍ´«Ë͵½ÏÂÒ»¸öASPÒ³ÃæÉÏÈ¥£¡
²»ÏëʹÓÃlocation.href="mnn.asp?action="+ok1ÕâÑùµÄ·½Ê½´«Ë͹ýÈ¥
......
ÀàËÆÕâÑùµÄtmpContent = tmpContent.replace(/" "+\r\n/g,"\r\n");
tmpContentµÄÖµÊÇ´ÓÒ³ÃæµÄÒ»¸ötextareaµÃµ½µÄ£¬textareaÀïÃæÊäÈëµÄÄÚÈÝÊÇÓû§ËæÒâÊäÈëµÄÎı¾ÄÚÈÝ
ÎÒµÄÄ¿µÄÊÇ£º ......
javascript¶¯Ì¬ÍøÒ³¿ª·¢Ïê½â ÕâÊéÔõôÑù
Ï´ÎÏ£ÍûÄãÄܰÑÏëÎʵÄÎÊÌâ½²Çå³þ£¬²»È»ºÜÄÑÓÐÈ˻شðÄãµÄÎÊÌâ¡£
ÄãÕâÑùÎÊ»ù±¾Éϲ»Á˽âÄãÏëÒªÖªµÀЩʲô¡£
£º£©
ÊÇÕâÑùµÄ£¡
Ò»£¡£¡ÎÒ·¢ÏÖÂ¥ÉϺÍÎÒ³¤Ïà²î²»¶ ......