StupidBeauty
Read times:430Posted at:Sat May 26 16:16:17 2012
- no title specified

转载:有返回值的函数

javascript函数想提供返回值时,只需在最后写上“return Result”即可,Result便是要返回的值。

http://www.blabla.cn/js_examples/008_js_function_returnvalue.html

亮点:

html>

<head>

<title>一个有返回值的函数及其调用的Javascript示例代码</title>

<script type="text/jahttp://www.blabla.cn/js_examples/008_js_function_returnvalue.htmlvascript">

function mySite()

{

return ("www.blabla.cn")

}

</script>

</head>

<body>

<script type="text/javascript">

document.write(mySite())

</script>

<p>该网页所用的Javascript代码解释:在网页head部分写了一个函数mySite,返回值是"www.blabla.cn",然后在body里调用这个函数,显示这个函数的返回值。</p>

</body>

</html>

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4