WEB开发网
开发学院软件开发Java JAVA AJAX教程第二章-JAVASCRIPT基础知识 阅读

JAVA AJAX教程第二章-JAVASCRIPT基础知识

 2009-10-27 00:00:00 来源:WEB开发网   
核心提示: 9 字符串搜索 程序代码 <scriptlanguage=”JavaScript”><!--varmyVariable=“Hellothere”;vartherePlace=myVariable.search(“the

9 字符串搜索

程序代码

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

10 字符串替换

程序代码

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

11 格式化字串

程序代码

<script language=”JavaScript”> 
<!-- 
var myVariable = “Hello there”; 
document.write(myVariable.big() + “<br>”); 
document.write(myVariable.blink() + “<br>”); 
document.write(myVariable.bold() + “<br>”); 
document.write(myVariable.fixed() + “<br>”); 
document.write(myVariable.fontcolor(“red”) + “<br>”); 
document.write(myVariable.fontsize(“18pt”) + “<br>”); 
document.write(myVariable.italics() + “<br>”); 
document.write(myVariable.small() + “<br>”); 
document.write(myVariable.strike() + “<br>”); 
document.write(myVariable.sub() + “<br>”); 
document.write(myVariable.sup() + “<br>”); 
document.write(myVariable.toLowerCase() + “<br>”); 
document.write(myVariable.toUpperCase() + “<br>”); 
var firstString = “My String”; 
var finalString = firstString.bold().toLowerCase().fontcolor(“red”); 
// --> 
</script>  

上一页  3 4 5 6 7 8 9 10  下一页

Tags:JAVA AJAX 教程

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接