Answer the question
In order to leave comments, you need to log in
How to correctly load multiple JSON from a file?
First received the file by
$.ajax({
type: 'POST',
dataType:'json',
url: 'tab.json',
$(document).ready(function(){
var habrahabr = [
{d: "google", sd: "http://toster.ru/rss/tag_questions/7?ss=1", style:"background: #F6D3D3;" },
{d: "hubs", sd: "http://habrahabr.ru/rss/hubs/?q=1", style:"background: #999900;" }];
var google = [
{d: "xakep ru", sd: "http://www.xakep.ru/articles/rss/default.asp?ss=1", style:"background: #CCBFBF;" },
{d: "Science", sd: "http://gdata.youtube.com/feeds/api/videos?category=Science%7CTechnology&time=today", style:"background:#D3EDF6;" } ];
Answer the question
In order to leave comments, you need to log in
The code you provided is never json, it's regular js, include it as a script if you want, and it's not clear why you're picking it up via POST. It is also not clear why it is wrapped in document.ready.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question