Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How display the following JSON object in html using Jquery

Posted on 2011-09-19
1
Medium Priority
?
340 Views
Last Modified: 2012-05-12
hi, I have the following JSON object I need to display it using Jqury as a list of links like the following format:
1- <a href="Article_Url">Article_Title</a>
2- <a href="Article_Url">Article_Title</a>
...
Here is the JSON object:
{{"Columns":["id","Article_Url","Article_Title","Date","num"],"Rows":[["5bb93b83-d129-4ca9-8999-ed54910b824d","www.fomain.com//test.html","test","\/Date(1316189236173)\/",25],["82d62b61-d96b-489a-ae91-008b897db553","97.74.67.146/testx.html?xx=x","test","\/Date(1316256259490)\/",11],["97aaf346-1146-429e-bc5a-fcfa4b2d934b","97.74.67.146/testx.html","test","\/Date(1316255702510)\/",4],["2fea1222-e254-4db9-a68e-5129a0d87e8e","97.74.67.146/qn_news_story_s.asp?storyid=1093442005","Oman invests USD3.8b in constructing dry dock","\/Date(1316188504010)\/",2],["82fe900d-eefe-4540-87a4-1fe6057234a7","http://www.menafn.com/qn_news_story.asp?StoryId={83510500-a24b-4f87-9bf1-3985134ee4b6}","Title 1","\/Date(1315411910897)\/",1]]} 

Open in new window

0
Comment
Question by:Sindibad_123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36562864
you need to remove the first accolade : {
{"Columns":["id","Article_Url","Article_Title","Date","num"],"Rows":[["5bb93b83-d129-4ca9-8999-ed54910b824d","www.fomain.com//test.html","test","\/Date(1316189236173)\/",25],["82d62b61-d96b-489a-ae91-008b897db553","97.74.67.146/testx.html?xx=x","test","\/Date(1316256259490)\/",11],["97aaf346-1146-429e-bc5a-fcfa4b2d934b","97.74.67.146/testx.html","test","\/Date(1316255702510)\/",4],["2fea1222-e254-4db9-a68e-5129a0d87e8e","97.74.67.146/qn_news_story_s.asp?storyid=1093442005","Oman invests USD3.8b in constructing dry dock","\/Date(1316188504010)\/",2],["82fe900d-eefe-4540-87a4-1fe6057234a7","http://www.menafn.com/qn_news_story.asp?StoryId={83510500-a24b-4f87-9bf1-3985134ee4b6}","Title 1","\/Date(1315411910897)\/",1]]} 

Open in new window


else use :
    $.each(json["Rows"], function(i,el) {
        $("#here").append("<a href=\"" + el[1] + "\">" + el[2] + "</a><br />");  
    })

TEST PAGE : http://jsfiddle.net/DxHQr/
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question