Click here to Skip to main content
15,889,216 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Onclick event inside loop/fast clicking Pin
jkirkerx16-Jan-15 6:57
professionaljkirkerx16-Jan-15 6:57 
QuestionTooltip is not closing after the window is closed Pin
indian14314-Jan-15 5:41
indian14314-Jan-15 5:41 
AnswerRe: Tooltip is not closing after the window is closed Pin
jkirkerx15-Jan-15 10:19
professionaljkirkerx15-Jan-15 10:19 
AnswerRe: Tooltip is not closing after the window is closed Pin
jkirkerx15-Jan-15 10:25
professionaljkirkerx15-Jan-15 10:25 
GeneralRe: Tooltip is not closing after the window is closed Pin
indian14320-Jan-15 7:54
indian14320-Jan-15 7:54 
Questionhow do i put an uploaded image in a folder Pin
websource11-Jan-15 12:57
websource11-Jan-15 12:57 
AnswerRe: how do i put an uploaded image in a folder Pin
marmo1211-Jan-15 22:00
marmo1211-Jan-15 22:00 
QuestionJSON data not giving the wanted output Pin
Member 113621248-Jan-15 7:52
Member 113621248-Jan-15 7:52 
I think the getJSON should be taking the JSON URL and returning it as a response - The data file has Author x3 Body x3 and Title x3. Once it has this it should map it into the nodes and give me three nodes for each section of data.

However currently its giving me the console.log output that I have below and nothing in my nodes var.

Console Log:

script.js:7 [Object, Object, Object]0: Object1: Object2: Objectlength: 3__proto__: Array[0]


Code:

JavaScript
$(document).ready(function(){

    var url         = "assets/js/data.json";

    $.getJSON(url).done(function(response) {

    var nodes = response.map(function(i) {
        return $('<div>').append(
            $('<div>', {class: 'title'}).text(i.title),
            $('<div>', {class: 'author'}).text(i.author),
            $('<div>', {class: 'body'}).text(i.body)
        );

        console.log(response);
    });
});

});//Ready function closed

AnswerRe: JSON data not giving the wanted output Pin
borchef11-Jan-15 22:00
borchef11-Jan-15 22:00 
QuestionSimple Calculation Question Pin
Ryan McElveen2-Jan-15 11:08
Ryan McElveen2-Jan-15 11:08 
SuggestionRe: Simple Calculation Question Pin
Richard MacCutchan2-Jan-15 22:08
mveRichard MacCutchan2-Jan-15 22:08 
Questionneed source code for advance cricket game? Pin
Member 113164161-Jan-15 17:11
Member 113164161-Jan-15 17:11 
AnswerRe: need source code for advance cricket game? Pin
Agent__0071-Jan-15 17:47
professionalAgent__0071-Jan-15 17:47 
AnswerRe: need source code for advance cricket game? Pin
Abhinav S1-Jan-15 19:04
Abhinav S1-Jan-15 19:04 
QuestionHow to integrate these scripts into one??? Pin
samflex23-Dec-14 6:03
samflex23-Dec-14 6:03 
QuestionCan someone please help me with a code about a YAHTZEE game ( without using any objects) ???? Pin
Member 1132460720-Dec-14 0:52
Member 1132460720-Dec-14 0:52 
SuggestionRe: Can someone please help me with a code about a YAHTZEE game ( without using any objects) ???? Pin
Richard MacCutchan20-Dec-14 1:47
mveRichard MacCutchan20-Dec-14 1:47 
QuestionConcatenating two fields using javascript? Pin
samflex19-Dec-14 8:35
samflex19-Dec-14 8:35 
AnswerRe: Concatenating two fields using javascript? Pin
Graham Breach19-Dec-14 21:55
Graham Breach19-Dec-14 21:55 
GeneralRe: Concatenating two fields using javascript? Pin
samflex20-Dec-14 1:27
samflex20-Dec-14 1:27 
GeneralRe: Concatenating two fields using javascript? Pin
Tushar sangani20-Dec-14 1:32
professionalTushar sangani20-Dec-14 1:32 
QuestionjQuery bgiframe.js error: "jQuery error: JavaScript runtime error: Unable to get property 'msie' of undefined or null reference" Pin
Stephen Holdorf15-Dec-14 23:41
Stephen Holdorf15-Dec-14 23:41 
AnswerRe: jQuery bgiframe.js error: "jQuery error: JavaScript runtime error: Unable to get property 'msie' of undefined or null reference" Pin
Stephen Holdorf16-Dec-14 7:03
Stephen Holdorf16-Dec-14 7:03 
Questionjavascript slider Pin
Member 112981529-Dec-14 5:25
Member 112981529-Dec-14 5:25 
AnswerRe: javascript slider Pin
Richard MacCutchan9-Dec-14 6:15
mveRichard MacCutchan9-Dec-14 6:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.