Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions accessing data from a json file writing javascript or using jQuery
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Robin
accessing data from a json file writing javascript or using jQuery
0 Answer(s)      3 years and 10 months ago
Posted in : JavaScript Questions


I am trying to create a page from json objects using javascript. I have this huge json file containing several objects that contain arrays for the objects. Also, I believe it writes some html for breadcrumbs or navigation bar. The entire page is built from this json file, but I can't figure out how to code the javascript or use jquery to get the page to display in the browser.

I've tried using alert() or document.writeln(), document.write() to at least see if I am correctly accessing the attributes in the json file. Nothing is working. I'm new to javascript using json to create html pages, objects and accessing objects in json writing javascript. Here is some code:

    var novdata= {
'categories':[
{N:'nwItem1',O:'Composition',V:School Supplies > Paper> Notebooks},
{N:'nwItem2,O:'Crayons',V:'Elementary > Art > Art Supplies'},
{N:'nwItem3',O:'Calculators',V:'High School > College Prep> Trigonometry'},
{N:'nwItem4',O:'Maps',V:'Middle School > US History > Civil War'}
],

'brands': [ 
{N:'nwItem11',O:'National'},
{N:'nwItem22,O:'Crayola'},
{N:'nwItem33',O:'Texas Instruments'},
{N:'nwItem44',O:'Atlas'}
],


'grades': [
{U:'http://www.donson.net/cp/Notebooks-Academic-School/RED-43481.',O:Kindergarten},
{U:'http://www.crayola.com/',O:'Fourth Grade'},
{U:'http://www.ti.com/',O:'Twelth Grade'},
{U:'http://shop.nationalgeographic.com/ngs/product/books/atlases-and-reference/national-geographic-9th-edition-atlas-of-the-world---softcover?code=SR60001',O:'Sixth Grade'}

],

'purchase': [
{U:'http://www.amazon.com',O:Kindergarten},
{U:'http://www.walmart.com/',O:'Fourth Grade'},
{U:'http://www.overstock.com/',O:'Twelth Grade'},
{U:'http://www.bn.com',O:'Sixth Grade'}

],

}

alert("I am testing " + novdata.categories);

Advertisement
View Answers

Related Tutorials/Questions & Answers:
accessing data from a json file writing javascript or using jQuery
accessing data from a json file writing javascript or using jQuery  I am trying to create a page from json objects using javascript. I have... to javascript using json to create html pages, objects and accessing objects
Getting Json data from servlet to javascript variable
Getting Json data from servlet to javascript variable  How do i get json data from my servlet on to a variable in javascript n bind the data to display onto sigma grid.Has anyone Idea how to do
Advertisements
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project... is text and all others are of currency data type. If i enter 0 or null value in currency column and then try to retrieve data using my servlet coding
Accessing Jqxgrid data in Controller layer using JSP
Accessing Jqxgrid data in Controller layer using JSP  I am using Keyboard Navigation jqxgrid. I am able to bind the grid by passing data from controller layer using JAVA. What i actually require is to fetch the data which
How to save form data to a csv file using jquery or ajax
How to save form data to a csv file using jquery or ajax  Please let...=data.responseText; Now the problem is ,i should write form data to a csv file using ajax... this. i am able to read the csv file using this code if (window.XMLHttpRequest
jQuery ajax json
jQuery ajax json  Hi, How to use jQuery to load json data through..., textStatus, xhr) ] ) at client side to process the json data. Thanks... to crate the json response: JSONObject obj=new JSONObject(); obj.put("name","foo
Accessing MS ACCESS databse using a HTML webpage [created using Javascript]
Accessing MS ACCESS databse using a HTML webpage [created using Javascript...... I have to save some datas in an MS ACCESS database file [*.mdb], after... columns in the *.mdb file. Then, the datas in that *.mdb file should
Fetching the exact data from file using java
Fetching the exact data from file using java  **hi ... i am having one .lst file.. that file consists of instructions and opcodes.. now i want to fetch only the opcode from that file.. could u pls anyone guide me this using java
Getting data from servlet into javascript
Getting data from servlet into javascript  How do i get json data from my servlet on to a variable in javascript n bind the data to display onto sigma grid.Has anyone Idea how to do
Show Limited Data Using jquery
Show Limited Data Using jquery  How to show limited results in JQuery... it using JQuery?   See the JQuery example to show the limited fetch results in JQuery. var comments = $('.description_text').size(); if (comments >
How to write a search functionality using javascript/jquery
How to write a search functionality using javascript/jquery   How to write a search functionality using javascript/jquery for ex: im searching "s" names it wil display "s" names
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java   reading the data from Html file
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java    How to export data from html file to excel sheet by using java
How to access the image file from project folder itself while writing to pdf using itext?
How to access the image file from project folder itself while writing to pdf using itext?  I am writing a pdf using itext where i add a image... it to pick it up from the project folder itself.Because later i deploy the project
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp  read data from excel file and update database using jsp Hi, I am using a MySQL database for scientific research analysis. My team members sends research data in excel file
Sava data from Form to XML file using strutrs
Sava data from Form to XML file using strutrs  I'am a biginner with struts want so save data from my form in an Xml file using struts but i'm searching witout finding a solution thanks fo your help
How to Retrieve Data from the database and write into excel file using Java
How to Retrieve Data from the database and write into excel file using Java  Hi, I am trying to develop an small application where i trying to retrieve Data from the database and store the details in excel file. Please can
JSON in JavaScript
JSON  with JavaScript.  Creating Object in JavaScript using JSON We can... this JavaScript and JSON example you have to just run this ".htm" file on your... JSON in JavaScript     
JSON array objects retrieval in javascript
JSON array objects retrieval in javascript   I am fetching some data from database and want to show these values in a combo in javascript but combo... or javascript, can anybody tell me where i am wrong? From db 5 values are coming
create login page using data from text file
create login page using data from text file  I want to create login page using data store in textfile(data submit from regiter page to textfile) using jsp and servlet. Thanks
Data needs to be gathered in XML file from the database (MySql) using JSP
Data needs to be gathered in XML file from the database (MySql) using JSP ... data regarding particular id from the database table. Data needs to be gathered in XML file from the database (MySql) using appropriate JSP/Java Bean functions
fetch data from database in javascript
fetch data from database in javascript   How to fetch data from database in JavaScript when it is a leap year
Writing a file using servlets - JSP-Servlet
Writing a file using servlets  I'm using a servlet to read an input from a jsp file and write into a .txt file in my computer. The code is good until reading the data and creating a file in my space. but it is not writing
accessing xml using java
accessing xml using java  I need to retrieve some elements in xml file using java   Hi Friend, Please visit the following links: http...-text-values-from-a-nodel.shtml http://www.roseindia.net/xml/dom/GetData.shtml
how to validate the telephone number without using jquery in html with javascript
how to validate the telephone number without using jquery in html with javascript  how to validate the telephone number without using jquery in html with javascript
JSON-RPC-Java
objects to and from JavaScript objects using Java reflection. Read full... JSON-RPC-Java       JSON-RPC-Java is an AJAX RPC middleware that allows JavaScript DHTML web applications
json
;Differences: 1)Ajax is a concept of using JavaScript for asynchronous calls... data is transferred and how it is encoded. While JSON is a tool used... is JavaScript Object Notation. It is a safe and reliable data interchange format
Writing to and reading from a binary file in java.
Writing to and reading from a binary file in java.  I have written the following code to convert an ASCII text file to a binary file: public static... the binary file from another program as follows: m_dis = new DataInputStream
Hi how to transfer table data from html page to excel sheet by using javascript .
Hi how to transfer table data from html page to excel sheet by using javascript .  html page to excel sheet by using javascript and i dont want to transfer all rows in table, i want to hide some rows in excel sheet. Please send
retrieve JSON array objects in javascript
retrieve JSON array objects in javascript  I am getting one value by JSON array, but how can i store multiple values in json array and how can i retieve it by javascript? Any help please auto.jsp <script type="text
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print, which works for all the browser specially chrome and firefox, I have used
 

 

 

DMCA.com