jQuery.parseJSON - Utilities , jQuery |
jQuery.parseJSON() เป็นการใช้ jQuery Utilities กับ jQuery.parseJSON() จะเป็นรูปแบบสตริง JSON และส่งกลับวัตถุ JavaScript ที่เกิดขึ้น
Syntax
1. jQuery.parseJSON( json )
Example ตัวอย่างการใช้งาน jQuery jQuery.parseJSON()
jQueryparseJSON.html

01. <html>
02. <head>
03. <title>ThaiCreate.Com jQuery Tutorials</title>
04. <script type= "text/javascript" src= "jquery-1.6.4.js" ></script>
05. <script type= "text/javascript" >
06. $(document).ready( function (){
07.
08. var obj = jQuery.parseJSON( '{"name":"John"}' );
09. $( "p" ).text(obj.name == "John" );
10.
11. });
12. </script>
13. </head>
14. <body>
15.
16. <p></p>
17.
18. </body>
19. </html>
Screenshot

คำอธิบาย (ภาษาไทย)
จากตัวอย่างเป็นการใช้ jQuery Utilities กับ jQuery.parseJSON() ในการจัดการกับ element ที่อ้างถึง
ลิ้งค์ที่ควรศึกษา
Go to : jQuery Selectors : jQuery Selectors and Element
เกี่ยวกับบทความ
ส่วนหนึ่งของบทความได้เรียบเรียงและแปลจากเว็บไซต์ jQuery.Com โค้ดตัวอย่างคำสั่งนี้อยู่ภายใต้สัญญาอนุญาตของ GFDL สามารถนำโค้ดและคำสั่งใช้งานได้ฟรี สงวนลิขสิทธิ์เฉพาะคำอธิบายภาษาไทย
|
|
Total Votes: 177Overall Rating: 3.9 / 5 |
|
 |
|
|
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท
|
|
|
By : |
ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ) |
|
Score Rating : |
  |
|
|
Create/Update Date : |
2011-09-22 22:00:11 /
2017-03-19 14:14:32 |
|
Download : |
No files |
|
Sponsored Links / Related |
|
|
|
|
|
|