Response title
This is preview!
{
"Caption": "Module caption",
"IconsDirectory": "C://Images/",
"Buttons": [
{
"Conditions": [
{
"ConditionText": "1 == 1",
"ButtonText": "Text1",
"Visible": true,
"Colors": {
"FontColor": "#FFFFFF",
"BGColor": "#00FF00"
},
"Size": {
"Width": 200,
"Height": 50
},
"Icon": {
"FileName": "Smile.png",
"Width": 16,
"Height": 16
},
"Url": {
"UrlAddress": "http://www.google.com",
"OpenNewWindow": true
},
"JavascriptAction": {
"Text": "alert('ok');"
}
},
{
"ConditionText": "2 == 2",
"ButtonText": "Text2",
"Visible": true,
"Colors": {
"FontColor": "#FFFFFF",
"BGColor": "#00FF00"
},
"Size": {
"Width": 200,
"Height": 50
},
"Icon": {
"FileName": "Smile.png",
"Width": 16,
"Height": 16
},
"Url": {
"UrlAddress": "http://www.google.com",
"OpenNewWindow": true
},
"JavascriptAction": {
"Text": "alert('ok');"
}
}
]
}
]
}
<html>
<head>
<title>SMButtons</title>
[removed][removed]
[removed]
//When document loaded.
$(document).ready(function(){
// Get data from file as JSON
$.getJSON('weekendtask.json', function(data) {
var buttons = data.Buttons;
$.each(buttons, function(key, val)
{
$('<li><input type="button" value="'+ val.ButtonText +'"/></li>').appendTo('#ulObj');
});
});
});
[removed]
</head>
<body>
<br>
<br>
<div>
<ul id='ulObj'>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</div>
</body>
</html>
val.Conditions[0]['Colors'].FontColor
but I can not understand how.val.Conditions[0].Colors.FontColor
$('<li><input type="button" onClick="'+ val.Conditions[0].JavaScriptAction +'" value="'+ val.Conditions[0].ButtonText +'"/></li>').appendTo('#ulObj');
function WCFJSON() {var userid = "2";Type = "POST";Url = "Service.svc/GetUser";Data = '{"Id": "' + userid + '"}';ContentType = "application/json; charset=utf-8";DataType = "json"; varProcessData = true;CallService();}
$(document).ready(function () {WCFJSON();});
<body><!--...--></body>
Hi all,
could you please give me some simple example on jquery + wcf + sql ? I mean, my need is to create wcf service for getting data from sql table, jquery should help show result at web page. I'm newbie, help me please.
© 2013 jQuery Foundation
Sponsored by and others.