国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

簡介JavaScript中Boolean.toSource()方法的使用

2024-05-06 16:21:26
字體:
來源:轉載
供稿:網友

這篇文章主要介紹了簡介JavaScript中Boolean.toSource()方法的使用,是JS入門學習中的基礎知識,需要的朋友可以參考下

JavaScript Boolean.toSource()方法返回表示對象的源代碼的字符串。

注意:此方法不會在Internet Explorer中運行。

語法

 

 
  1. boolean.toSource() 

下面是參數的詳細信息:

NA

返回值

返回表示對象的源代碼的字符串。

例子:

 

 
  1. <html> 
  2. <head> 
  3. <title>JavaScript toSource() Method</title> 
  4. </head> 
  5. <body> 
  6. <script type="text/javascript"
  7. function book(title, publisher, price) 
  8. this.title = title; 
  9. this.publisher = publisher; 
  10. this.price = price; 
  11. var newBook = new book("Perl","Leo Inc",200);  
  12. document.write(newBook.toSource());  
  13. </script> 
  14. </body> 
  15. </html> 

這將產生以下結果:

 

 
  1. ({title:"Perl", publisher:"Leo Inc", price:200}) 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 成武县| 涟水县| 栖霞市| 肇庆市| 内江市| 赫章县| 新丰县| 遂昌县| 德江县| 屯昌县| 青神县| 石家庄市| 富民县| 连平县| 庄浪县| 漾濞| 都匀市| 湖南省| 镇平县| 金湖县| 古蔺县| 平邑县| 望都县| 聂拉木县| 静安区| 兴安盟| 滕州市| 田阳县| 宁陕县| 布尔津县| 蕉岭县| 水城县| 商南县| 玉环县| 长沙市| 辛集市| 平安县| 青阳县| 綦江县| 渭源县| 磐石市|