Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I got a very similar question here: jQuery progressbar with ajax request to json

Can you help me here with a solution?

I try to get the path out of a *.json file and use it for an "input image field" with jquery.

HTML

<input id="pic_1" type="image" src="<!-- what to do here? -->" /> 

JS

$(function() {
    $.ajax({ dataType:"json",
        url: test.json, 
        success: <!-- what to do here? -->,
    });
});

test.json

{ "pic_1":"img/test.png" }

would be glad for similar solution, due to jQuery progressbar with ajax request to json !

Thank you

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
264 views
Welcome To Ask or Share your Answers For Others

1 Answer

Why don't you use $.getJSON() http://api.jquery.com/jquery.getjson/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...