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 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);
View Answers
Ads
Related Tutorials/Questions & Answers:
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
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
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
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
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
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 >
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
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
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
Insert Data From File
Insert
Data From File
Insert
Data From File is used to insert
data from file... to insert
data from file. To understand
this example, we create a table 'Stu_Table
Insert Data From File
Insert
Data From File
Insert
Data From File is used to insert
data from file... to insert
data from file. To understand
this example, we create a table 'Stu_Table