欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaScript基本入門(mén)語(yǔ)法集合第1/3頁(yè)

 更新時(shí)間:2008年09月14日 21:13:22   作者:  
對(duì)于新手來(lái)說(shuō),掌握下面的方法,基本上就可以自己些js了,入門(mén)必備
創(chuàng)建腳本塊
<script language=”JavaScript”>
JavaScript code goes here
</script>
隱藏腳本代碼

<script language=”JavaScript”>
<!--
document.write(“Hello”);
// -->
</script>

瀏覽器不支持的時(shí)候顯示

<noscript>
Hello to the non-JavaScript browser.
</noscript>

鏈接外部腳本文件

<script language=”JavaScript” src="/”youname.js"”></script>

注釋腳本

// This is a comment
document.write(“Hello”); // This is a comment
/*
All of this
is a comment
*/

輸出到瀏覽器

document.write(“<strong>輸出內(nèi)容</strong>”);

定義變量

var myVariable = “some value”;

字符串相加

var myString = “String1” + “String2”;

字符串搜索

<script language=”JavaScript”>
<!--
var myVariable = “Hello there”;
var therePlace = myVariable.search(“there”);
document.write(therePlace);
// -->
</script>

字符串替換

thisVar.replace(“Monday”,”Friday”);

相關(guān)文章

最新評(píng)論