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
Related Tutorials/Questions & Answers:
Advertisements
Problem in accessing data from DatabaseProblem 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
How to save form data to a csv file using jquery or ajaxHow 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
Accessing Jqxgrid data in Controller layer using JSPAccessing 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 javaFetching 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
Show Limited Data Using jqueryShow 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 javascriptGetting
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
Read data from excel file and update database using jspRead
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 create login page using data from text filecreate 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
Sava data from Form to XML file using strutrsSava
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
Writing a file using servlets - JSP-ServletWriting 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 how to print HTML using javascript or Jqueryhow 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
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
Insert Data From File Insert
Data From File
Insert
Data From File is used to insert
data from file... an example to insert
data from file. To understand
this example, we create
Insert Data From File Insert
Data From File
Insert
Data From File is used to insert
data from file... an example to insert
data from file. To understand
this example, we create
Showing content of a file using JSP & jQuery Showing content of a
file using JSP &
jQuery
In this tutorial , we will discuss how to display text ,saved in a text
file
using JSP &
jQuery.... The html
file contains a text area and a button. On
clicking button,
jQuery JavaScript get excel file data
JavaScript get excel
file data...;
By the use of
JavaScript we can get the excel
file data as well. Here is the
example which gets the
data from the excel
file with the cell and row index
accessing xml using javaaccessing xml
using java I need to retrieve some elements in xml
file using java
Hi Friend,
Please visit the following links:ADS.../xml/getting-text-values-
from-a-nodel.shtml
http://www.roseindia.net/xml/dom
Data extraction from an image file.Data extraction
from an image
file. I have made an image...
data from the the image which also include deleted data.Can i used java to extract these
data from the image
file? Which are the libraries to be used
Get Data From the XML File Get
Data From the XML
File
Here you will learn to
retrieve
data from XML
file using SAX parser. We use the JAXP
APIs to retrieve
data from XML document .
Description
Python extract data from JSONPython extract
data from JSON Hi,
I have a program that reads
json data from third part web service. My webservice is returning
json and I am...,
For parsing and getting the
data from JSON. You can use the
json library which ships
Export data into CSV File using Servlet Export
data into CSV
File using Servlet
... to Export
data
into CSV
file
using Servlet. We have created
file "JdbcCsvFile.java" to export
data from this .java
file..
Brief
Accessing Database using EJB Accessing Database
using EJB
... through the EJB example given below to find out the steps involved in
accessing... is that through it we can create a
java source
file which contain the bean implementation