Más contenido relacionado Similar a Web Basics 2013-01-10 (20) Web Basics 2013-01-1052. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<h1>ようこそ<!--#4DTEXT [CONTACTS]FirstName--></h1>
<p>ユーザー名: <!--#4DTEXT vtUserName--></p>
<!--#4DTEXT myArray{7}-->
<!--#4DTEXT Current time-->
<!--#4DTEXT Records in selection([INVOICES])-->件のレ
コードがみつかりました。
53. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<h1>ようこそ<!--#4DHTML [CONTACTS]FirstName--></h1>
<p>ユーザー名: <!--#4DHTML vtUserName--></p>
<!--#4DHTML myArray{7}-->
54. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<h1>ようこそ<!--#4DHTML [CONTACTS]FirstName--></h1>
<p>ユーザー名: <!--#4DHTML vtUserName--></p>
<!--#4DHTML myArray{7}-->
[Contacts]lastName:="<b>MIYAKO</b> Keisuke"
vtUserName:= "<font color="red">MIYAKO</font>"
myArray{7}:="<a href="http://www.4d.com">4D</a>"
56. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--#4DSCRIPT/MethodName/Param-->
57. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--#4DSCRIPT/MethodName/Param-->
/Param
58. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--#4DSCRIPT/MethodName/Param-->
/Param
公開メソッド
59. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--#4DSCRIPT/MethodName/Param-->
/Param
公開メソッド
61. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--#4DINCLUDE header/menu.html-->
63. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<div>
<!--4DIF (vNumRecords>0)-->
<p><!--4DTEXT vNumRecords-->件みつかりました。</p>
<!--4DELSE-->
<p>何もみつかりませんでした。</p>
<!--4DENDIF-->
</div>
64. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<div>
<!--4DIF (vNumRecords>0)-->
<p><!--4DTEXT vNumRecords-->件みつかりました。</p>
<!--4DELSE-->
<p>何もみつかりませんでした。</p>
<!--4DENDIF-->
</div>
<div>
<!--4DIF (Condition1)-->
<!--4DINCLUDE menu1.html-->
<!--4DELSEIF (Condition2)-->
<!--4DINCLUDE menu2.html-->
<!--4DELSEIF (Condition3)-->
<!--4DINCLUDE menu3.html-->
<!--4DELSE-->
<!--4DINCLUDE menu.html-->
<!--4DENDIF-->
</div>
66. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--4DLOOP (arrCities)-->
<p><!--4DTEXT arrCities{arrCities}--></p>
<!--4DENDLOOP-->
67. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--4DLOOP (arrCities)-->
<p><!--4DTEXT arrCities{arrCities}--></p>
<!--4DENDLOOP-->
<!--4DLOOP [CONTACTS]-->
<p><!--4DTEXT [CONTACTS]firstName--></p>
<!--4DENDLOOP-->
68. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--4DLOOP (arrCities)-->
<p><!--4DTEXT arrCities{arrCities}--></p>
<!--4DENDLOOP-->
<!--4DLOOP [CONTACTS]-->
<p><!--4DTEXT [CONTACTS]firstName--></p>
<!--4DENDLOOP-->
<!--4DLOOP allowAction-->
<p><!--4DTEXT actionResult--></p>
<!--4DENDLOOP-->
70. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--4DINCLUDE header.html-->
<!--4DBASE folder/-->
<!--4DINCLUDE subpage1.html-->
<!--4DINCLUDE subpage2.html-->
<!--4DINCLUDE subpage3.html-->
<!--4DBASE sub/-->
<!--4DINCLUDE subpage4.html-->
<!--4DINCLUDE subpage5.html-->
<!--4DINCLUDE subpage6.html-->
<!--4DBASE WEBFOLDER-->
<!--4DINCLUDE footer.html-->
71. 基本
4Dタグ
• 4DTEXT
• 4DHTML
• 4DSCRIPT
• 4DINCLUDE
• 4DIF, 4DELSE, 4DENDIF
• 4DLOOP, 4DENDLOOP
• 4DBASE
<!--4DINCLUDE header.html-->
<!--4DBASE folder/-->
<!--4DINCLUDE subpage1.html-->
<!--4DINCLUDE subpage2.html-->
<!--4DINCLUDE subpage3.html-->
<!--4DBASE sub/-->
<!--4DINCLUDE subpage4.html-->
<!--4DINCLUDE subpage5.html-->
<!--4DINCLUDE subpage6.html-->
<!--4DBASE WEBFOLDER-->
<!--4DINCLUDE footer.html-->
Webfolder/header.html
Webfolder/folder/subpage1.html
Webfolder/folder/subpage2.html
Webfolder/folder/subpage3.html
Webfolder/folder/sub/subpage4.html
Webfolder/folder/sub/subpage5.html
Webfolder/folder/sub/subpage6.html
Webfolder/footer.html
99. 基本
On Web Connection
• $1リクエスト
• $2 HTTPヘッダ+ボディ(一部)
• $3 クライアントIPアドレス
• $4 サーバーIPアドレス
• $5 ユーザー名
• $6 パスワード
100. 基本
On Web Connection
• $1リクエスト
• $2 HTTPヘッダ+ボディ(一部)
• $3 クライアントIPアドレス
• $4 サーバーIPアドレス
• $5 ユーザー名
• $6 パスワード
WEB GET VARIABLES
101. 基本
On Web Connection
• $1リクエスト
• $2 HTTPヘッダ+ボディ(一部)
• $3 クライアントIPアドレス
• $4 サーバーIPアドレス
• $5 ユーザー名
• $6 パスワード
WEB GET HTTP HEADER
WEB GET VARIABLES
102. 基本
On Web Connection
• $1リクエスト
• $2 HTTPヘッダ+ボディ(一部)
• $3 クライアントIPアドレス
• $4 サーバーIPアドレス
• $5 ユーザー名
• $6 パスワード
WEB GET HTTP BODY
WEB GET HTTP HEADER
WEB GET VARIABLES
103. 基本
On Web Connection
• $1リクエスト
• $2 HTTPヘッダ+ボディ(一部)
• $3 クライアントIPアドレス
• $4 サーバーIPアドレス
• $5 ユーザー名
• $6 パスワード
WEB GET HTTP BODY
WEB GET HTTP HEADER
WEB GET HTTP BODY PARTS
WEB GET VARIABLES
107. 基本
• スタティック(静)
• HTML ページ
• images 画像
• css スタイル
• js スクリプト
• ダイナミック(動)
• HTML ページ
• images 画像
• json データ
108. 基本
• スタティック(静)
• HTML ページ
• images 画像
• css スタイル
• js スクリプト
• ダイナミック(動)
• HTML ページ
• images 画像
• json データ
115. 基本
• 4Dタグ
• On Web Connection
• .shtml
• 4DACTION
• WEB GET VARIABLES
• WEB SEND FILE
• WEB GET HTTP HEADER
• WEB GET HTTP BODY
116. 基本
• 4Dタグ
• On Web Connection
• .shtml
• 4DACTION
• WEB GET VARIABLES
• WEB SEND FILE
• WEB GET HTTP HEADER
• WEB GET HTTP BODY
• WEB SEND TEXT
• WEB SEND BLOB
• WEB SEND RAW DATA
• WEB SEND HTTP REDIRECT
123. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
124. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
125. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
126. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
127. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
128. C_TEXT($1;$0)
If (Count parameters>0)
$0:=$1
If (Length($0)#0)
$0:=Replace string($0;"";"";*)
$0:=Replace string($0;""";""";*)
$0:=Replace string($0;"/";"/";*)
$0:=Replace string($0;Char(Backspace);"b";*)
$0:=Replace string($0;Char(FF ASCII code);"f";*)
$0:=Replace string($0;"n";"n";*)
$0:=Replace string($0;"r";"r";*)
$0:=Replace string($0;"t";"t";*)
End if
End if
w_escapeText
jQuery
129. C_TEXT($1;$0)
If (Count parameters>0)
$0:=$1
If (Length($0)#0)
$0:=Replace string($0;"";"";*)
$0:=Replace string($0;""";""";*)
$0:=Replace string($0;"/";"/";*)
$0:=Replace string($0;Char(Backspace);"b";*)
$0:=Replace string($0;Char(FF ASCII code);"f";*)
$0:=Replace string($0;"n";"n";*)
$0:=Replace string($0;"r";"r";*)
$0:=Replace string($0;"t";"t";*)
End if
End if
w_escapeText
jQuery
130. C_TEXT($1;$0)
If (Count parameters>0)
$0:=$1
If (Length($0)#0)
$0:=Replace string($0;"";"";*)
$0:=Replace string($0;""";""";*)
$0:=Replace string($0;"/";"/";*)
$0:=Replace string($0;Char(Backspace);"b";*)
$0:=Replace string($0;Char(FF ASCII code);"f";*)
$0:=Replace string($0;"n";"n";*)
$0:=Replace string($0;"r";"r";*)
$0:=Replace string($0;"t";"t";*)
End if
End if
w_escapeText
jQuery
131. C_TEXT($1;$0)
If (Count parameters>0)
$0:=$1
If (Length($0)#0)
$0:=Replace string($0;"";"";*)
$0:=Replace string($0;""";""";*)
$0:=Replace string($0;"/";"/";*)
$0:=Replace string($0;Char(Backspace);"b";*)
$0:=Replace string($0;Char(FF ASCII code);"f";*)
$0:=Replace string($0;"n";"n";*)
$0:=Replace string($0;"r";"r";*)
$0:=Replace string($0;"t";"t";*)
End if
End if
w_escapeText
jQuery
132. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
133. jQuery
[
<!--4DLOOP [Contacts]-->
! {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
! }<!--4DTEXT w_endOfArrayItem(->[Contacts])-->
<!--4DENDLOOP-->
]
Resources/json/contacts.html
166. C_BOOLEAN($0;$isMobile)
ARRAY TEXT($headerNames;0)
ARRAY TEXT($headerValues;0)
WEB GET HTTP HEADER($headerNames;$headerValues)
C_LONGINT($i)
$i:=Find in array($headerNames;"User-Agent")
If ($i#-1)
$userAgent:=$headerValues{$i}
$isMobile:=True
Case of
: (Position("iPhone";$userAgent)#0)
: (Position("iPad";$userAgent)#0)
: (Position("Android";$userAgent)#0)
Else
$isMobile:=False
End case
End if
$0:=$isMobilew_isMobile
モバイル
167. C_BOOLEAN($0;$isMobile)
ARRAY TEXT($headerNames;0)
ARRAY TEXT($headerValues;0)
WEB GET HTTP HEADER($headerNames;$headerValues)
C_LONGINT($i)
$i:=Find in array($headerNames;"User-Agent")
If ($i#-1)
$userAgent:=$headerValues{$i}
$isMobile:=True
Case of
: (Position("iPhone";$userAgent)#0)
: (Position("iPad";$userAgent)#0)
: (Position("Android";$userAgent)#0)
Else
$isMobile:=False
End case
End if
$0:=$isMobilew_isMobile
モバイル
169. C_TEXT($1)
ARRAY LONGINT($pos;0)
ARRAY LONGINT($len;0)
If (Match regex("((.+).(.+))";$1;1;$pos;$len))
$fileName:=Substring($1;$pos{2};$len{2})
$fileType:=Substring($1;$pos{3};$len{3})
$filePath:=Get 4D folder(Current Resources folder)+
$fileType+Folder separator+$fileName+".html"
WEB SEND FILE($filePath)
End if
モバイル
w_sendFile
176. jQuery Mobile
<head>
! <meta charset="utf-8" />
! <meta name="viewport" content="width=device-width, initial-scale=1">
! <title>Contacts</title>
! <!--jQuery Mobile関連のスタイルシートです。-->! !
! <link rel="stylesheet" href="/css/jquery.mobile-1.2.0.min.css" />
! <link rel="stylesheet" href="/css/jquery.mobile.theme-1.2.0.min.css" />
! <link rel="stylesheet" href="/css/jquery.mobile.structure-1.2.0.min.css" />
! <!--はじめにjQuery本体を読み込みます。-->! !
! <script src="/js/jquery-1.8.2.min.js"></script>
! <!--つづけてjQuery Mobileを読み込みます。-->!! ! !
! <script src="/js/jquery.mobile-1.2.0.min.js"></script>
</head>
Resources/html/contacts-mobile.html
177. jQuery Mobile
<head>
! <meta charset="utf-8" />
! <meta name="viewport" content="width=device-width, initial-scale=1">
! <title>Contacts</title>
! <!--jQuery Mobile関連のスタイルシートです。-->! !
! <link rel="stylesheet" href="/css/jquery.mobile-1.2.0.min.css" />
! <link rel="stylesheet" href="/css/jquery.mobile.theme-1.2.0.min.css" />
! <link rel="stylesheet" href="/css/jquery.mobile.structure-1.2.0.min.css" />
! <!--はじめにjQuery本体を読み込みます。-->! !
! <script src="/js/jquery-1.8.2.min.js"></script>
! <!--つづけてjQuery Mobileを読み込みます。-->!! ! !
! <script src="/js/jquery.mobile-1.2.0.min.js"></script>
</head>
Resources/html/contacts-mobile.html
178. jQuery Mobile
<head>
! <meta charset="utf-8" />
! <meta name="viewport" content="width=device-width, initial-scale=1">
! <title>Contacts</title>
! <!--jQuery Mobile関連のスタイルシートです。-->! !
! <link rel="stylesheet" href="/css/jquery.mobile-1.2.0.min.css" />
! <link rel="stylesheet" href="/css/jquery.mobile.theme-1.2.0.min.css" />
! <link rel="stylesheet" href="/css/jquery.mobile.structure-1.2.0.min.css" />
! <!--はじめにjQuery本体を読み込みます。-->! !
! <script src="/js/jquery-1.8.2.min.js"></script>
! <!--つづけてjQuery Mobileを読み込みます。-->!! ! !
! <script src="/js/jquery.mobile-1.2.0.min.js"></script>
</head>
Resources/html/contacts-mobile.html
217. [ “Miyako”, “Keisuke”, “95015”, 38, true ]
myArray
配列インデックス 値
myArray[0] ➤ Miyako
myArray[1] ➤ Keisuke
myArray[2] ➤ 95015
myArray[3] ➤ 38
myArray[4] ➤ true
JSON配列の例
218. [ “Miyako”, “Keisuke”, “95015”, 38, true ]
JSON配列の例
配列インデックス 値
myArray{1} ➤ Miyako
myArray{2} ➤ Keisuke
myArray{3} ➤ 95015
myArray{4} ➤ 38
myArray{5} ➤ true
myArray
219. JSONオブジェクトの例
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
223. JSONオブジェクトの例
値キー
オブジェクト
{ “male” : true,
“city” : “Tokyo”,
“lastName” : “Miyako”,
“age” : 38,
“zip” : “95015”,
“firstName” : “Keisuke”,
“state” : “JP”
}
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
224. JSONオブジェクトの例
値キー
順不問
オブジェクト
{ “male” : true,
“city” : “Tokyo”,
“lastName” : “Miyako”,
“age” : 38,
“zip” : “95015”,
“firstName” : “Keisuke”,
“state” : “JP”
}
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
225. JSONオブジェクトの例
値キー
オブジェクトはキー/値ペア(連想配列)
順不問
オブジェクト
{ “male” : true,
“city” : “Tokyo”,
“lastName” : “Miyako”,
“age” : 38,
“zip” : “95015”,
“firstName” : “Keisuke”,
“state” : “JP”
}
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
226. オブジェクト表記
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
227. オブジェクト表記
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
myObject
228. オブジェクト表記
キー 値
myObject.firstName ➤ Keisuke
myObject.lastName ➤ Miyako
myObject.zip ➤ 95015
myObject.age ➤ 38
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“city” : “Tokyo”,
“state” : “JP”,
“zip” : “95015”,
“age” : 38,
“male” : true
}
myObject
231. Nested
Object
構造体は値
キー 値
phone.cell ➤ 734-555-1234
phone.work ➤ 734-555-2468
phone.home ➤ 734-555-1357
{ “cell” : “734-555-1234”,
“work” : “734-555-2468”,
“home” : “734-555-1357”
}
phone
233. Nested
Object
構造体は値
{ “cell” : “734-555-1234”,
“work” : “734-555-2468”,
“home” : “734-555-1357”
}
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“phone” :
}
phone
234. Nested
Object
構造体は値
{ “cell” : “734-555-1234”,
“work” : “734-555-2468”,
“home” : “734-555-1357”
}
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“phone” :
}
contact
phone
235. Nested
Object
構造体は値
キー 値
contact.phone.cell ➤ 734-555-1234
contact.phone.work ➤ 734-555-2468
contact.phone.home ➤ 734-555-1357
{ “cell” : “734-555-1234”,
“work” : “734-555-2468”,
“home” : “734-555-1357”
}
{ “firstName” : “Keisuke”,
“lastName” : “Miyako”,
“phone” :
}
contact
phone
242. 配列のネスト
[
[ 4, “Cape”, 699.00 ],
[ 6, “Cowl”, 1195.00 ],
[ 3, “Boots”, 395.00 ],
[ 1, “Batwing”, 697199.00 ]
]
243. 配列のネスト
lineItem
[
[ 4, “Cape”, 699.00 ],
[ 6, “Cowl”, 1195.00 ],
[ 3, “Boots”, 395.00 ],
[ 1, “Batwing”, 697199.00 ]
]
244. 配列のネスト
lineItem
lineItem[1][
[ 4, “Cape”, 699.00 ],
[ 6, “Cowl”, 1195.00 ],
[ 3, “Boots”, 395.00 ],
[ 1, “Batwing”, 697199.00 ]
]
245. 配列のネスト
lineItem
lineItem[1][
[ 4, “Cape”, 699.00 ],
[ 6, “Cowl”, 1195.00 ],
[ 3, “Boots”, 395.00 ],
[ 1, “Batwing”, 697199.00 ]
]
lineItem[1][2]
246. オブジェクトのネスト
{ “number” : “37584”,
“customerID” : “1690”,
“customerName” : “Bruce Wayne”,
“subtotal” : 708350.00,
“salesTax” : 63751.50,
“total” : 772101.50,
“lineItem” : [ {“qty”:4, “desc”:”Cape”, “price”:699.00},
{“qty”:6, “desc”:”Cowl”, “price”:1195.00},
{“qty”:3, “desc”:”Boots”, “price”:395.00},
{“qty”:1, “desc”:”Batwing”, “price”:697199.00}
]
}
247. オブジェクトのネスト
{ “number” : “37584”,
“customerID” : “1690”,
“customerName” : “Bruce Wayne”,
“subtotal” : 708350.00,
“salesTax” : 63751.50,
“total” : 772101.50,
“lineItem” : [ {“qty”:4, “desc”:”Cape”, “price”:699.00},
{“qty”:6, “desc”:”Cowl”, “price”:1195.00},
{“qty”:3, “desc”:”Boots”, “price”:395.00},
{“qty”:1, “desc”:”Batwing”, “price”:697199.00}
]
}
248. オブジェクトのネスト
invoice
{ “number” : “37584”,
“customerID” : “1690”,
“customerName” : “Bruce Wayne”,
“subtotal” : 708350.00,
“salesTax” : 63751.50,
“total” : 772101.50,
“lineItem” : [ {“qty”:4, “desc”:”Cape”, “price”:699.00},
{“qty”:6, “desc”:”Cowl”, “price”:1195.00},
{“qty”:3, “desc”:”Boots”, “price”:395.00},
{“qty”:1, “desc”:”Batwing”, “price”:697199.00}
]
}
249. オブジェクトのネスト
{ “number” : “37584”,
“customerID” : “1690”,
“customerName” : “Bruce Wayne”,
“subtotal” : 708350.00,
“salesTax” : 63751.50,
“total” : 772101.50,
“lineItem” : [ {“qty”:4, “desc”:”Cape”, “price”:699.00},
{“qty”:6, “desc”:”Cowl”, “price”:1195.00},
{“qty”:3, “desc”:”Boots”, “price”:395.00},
{“qty”:1, “desc”:”Batwing”, “price”:697199.00}
]
}
invoice.lineItem
invoice
250. オブジェクトのネスト
{ “number” : “37584”,
“customerID” : “1690”,
“customerName” : “Bruce Wayne”,
“subtotal” : 708350.00,
“salesTax” : 63751.50,
“total” : 772101.50,
“lineItem” : [ {“qty”:4, “desc”:”Cape”, “price”:699.00},
{“qty”:6, “desc”:”Cowl”, “price”:1195.00},
{“qty”:3, “desc”:”Boots”, “price”:395.00},
{“qty”:1, “desc”:”Batwing”, “price”:697199.00}
]
}
invoice
invoice.lineItem[1]
invoice.lineItem
251. オブジェクトのネスト
{ “number” : “37584”,
“customerID” : “1690”,
“customerName” : “Bruce Wayne”,
“subtotal” : 708350.00,
“salesTax” : 63751.50,
“total” : 772101.50,
“lineItem” : [ {“qty”:4, “desc”:”Cape”, “price”:699.00},
{“qty”:6, “desc”:”Cowl”, “price”:1195.00},
{“qty”:3, “desc”:”Boots”, “price”:395.00},
{“qty”:1, “desc”:”Batwing”, “price”:697199.00}
]
}
invoice
invoice.lineItem[1]
invoice.lineItem[1].desc
invoice.lineItem
252. function selectContact(ContactId){
! $.getJSON('data', 'id='+ContactId, function(data){
! ! !
$("#contactId").val(data.contactId);
! $("#firstName").val(data.firstName);
! $("#lastName").val(data.lastName);
! $("#email").val(data.email);
! $("#mobilePhone").val(data.mobilePhone);
! ! !
})
! return true;
}
JSON
WebFolder/js/contact-mobile.js
253. function selectContact(ContactId){
! $.getJSON('data', 'id='+ContactId, function(data){
! ! !
$("#contactId").val(data.contactId);
! $("#firstName").val(data.firstName);
! $("#lastName").val(data.lastName);
! $("#email").val(data.email);
! $("#mobilePhone").val(data.mobilePhone);
! ! !
})
! return true;
}
JSON
WebFolder/js/contact-mobile.js
256. {
! "contactId":"<!--4DTEXT w_escapeText([Contacts]id)-->",
! "firstName":"<!--4DTEXT w_escapeText([Contacts]firstName)-->",
! "lastName":"<!--4DTEXT w_escapeText([Contacts]lastName)-->",
! "email":"<!--4DTEXT w_escapeText([Contacts]email)-->",
! "mobilePhone":"<!--4DTEXT w_escapeText([Contacts]mobilePhone)-->"
}
JSON
Resources/json/contact.html