Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
var jsonQury = ?????
var json = ????
How should i declare it.
and wat namespaces or assembly should i declare.
Posted
Updated 26-Nov-18 11:55am

Please have a look on the bellow link :
How to create JSON object using jQuery[^]
JSON in JavaScript[^]
 
Share this answer
 
v2
Comments
Member 10628913 28-Feb-14 5:49am    
Thanks alot sir..
Sibasisjena 28-Feb-14 6:12am    
you are most welcome :)
some thing like this
for array:
JavaScript
var myJSONObject = {"bindings": [
        {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"},
        {"ircEvent": "PRIVMSG", "method": "deleteURI", "regex": "^delete.*"},
        {"ircEvent": "PRIVMSG", "method": "randomURI", "regex": "^random.*"}
    ]
};


for single object

JavaScript
var myJSONObject = {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"};
 
Share this answer
 
Comments
Member 10628913 28-Feb-14 5:49am    
Thanks alot sir..
Creation of an empty Object:
var JSONQury = {};

Creation of an object with attribute named item and value in string:
var JSONQury = { "item ":"pen", "price":15 };

Creation of new object:
var JSONQury = new Object();

Example which shows creation of an object in javascript using JSON:
XML
<!DOCTYPE html>
<html>
<head>
<title>JSON with JavaScript Object Creation </title>
<script language="javascript" >

  var JSONQury = { "item" : "pen", "manufactured"  : 2014 };
  document.write("<h1>JSON with JavaScript</h1>");
  document.write("<br/>");
  document.write("<p>Item Name="+JSONQury.item+"</p>");
  document.write("<p>Manufactured in="+JSONQury.manufactured+"</p>");

</script>
</head>
<body>
</body>
</html>
 
Share this answer
 
v2
Comments
Member 10628913 28-Feb-14 5:49am    
Thanks alot sir..
KumarSundeep 3-Mar-14 1:48am    
you are welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900