Question about loading reviews from a text API using JQueryjQuery get textarea textWhat is the best way to add options to a select from as a JS object with jQuery?jQuery get specific option tag textIs there a link to the “latest” jQuery library on Google APIs?jQuery Set Cursor Position in Text AreaStrip HTML from Text JavaScriptGet selected text from a drop-down list (select box) using jQueryHow to break/exit from a each() function in JQuery?jQuery Get Selected Option From DropdownCannot display HTML string
Is a Centaur PC considered an animal when calculating carrying capacity for vehicles?
Are there any to-scale diagrams of the TRAPPIST-1 system?
Unlock your Lock
Count the number of shortest paths to n
How do we improve collaboration with problematic tester team?
How to force GCC to assume that a floating-point expression is non-negative?
Why is there not a willingness from the world to step in between Pakistan and India?
What's the point of fighting monsters in Zelda BoTW?
How to determine algebraically whether an equation has an infinite solutions or not?
Which meaning of "must" does the Slow spell use?
Term used to describe a person who predicts future outcomes
Did anybody find out it was Anakin who blew up the command center?
Using a JoeBlow Sport pump on a presta valve
The term Feed-forward and its meaning?
and daughters were born to them (bereishis 6:1)
Talk interpreter
Why does the `ls` command sort files like this?
Can I take a boxed bicycle on a German train?
A first "Hangman" game in Python
Could the UK amend the European Withdrawal Act and revoke the Article 50 invocation?
Is this password scheme legit?
助けてくれて有難う meaning and usage
Why did Lucius make a deal out of Buckbeak hurting Draco but not about Draco being turned into a ferret?
Fill NaN based on previous value of row
Question about loading reviews from a text API using JQuery
jQuery get textarea textWhat is the best way to add options to a select from as a JS object with jQuery?jQuery get specific option tag textIs there a link to the “latest” jQuery library on Google APIs?jQuery Set Cursor Position in Text AreaStrip HTML from Text JavaScriptGet selected text from a drop-down list (select box) using jQueryHow to break/exit from a each() function in JQuery?jQuery Get Selected Option From DropdownCannot display HTML string
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
So I'm trying to load these reviews from a text API I've been given onto a webpage, here are two as an example.
["id":"1","product_id":"scooter","nickname":"James","review":"I'm impressed with the result","rating":"5","id":"2","product_id":"scooter","nickname":"Jerry","review":"Its rubbish","rating":"1"]
There are about 13 in total. To load them into my HTML document, I'm trying to use an ajax function with a loop, then adding the corresponding values into the html file with an append function. I know the javascript code below doesn't work because as none of the reviews have specific identifiers, the code I included pastes all of the review values in every h4 or p item in the html document every time.
My question is how do I fetch the nickname and review items from the API so that they only appear once each on my html document?
Example of where I want 2 reviews to load. The reviewer name in the h4 tag and the review itself within the p tag.
<div id="productreviews">
<img id="reviewimg1" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption1">Good God!!</h3>
<h4 class="idfont idposition" id="reviewuser1"></h4>
<p class="maintext" id="reviewmain1"></p>
<img id="reviewimg2" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption2">Great</h3>
<h4 class="idfont idposition" id="reviewuser2"></h4>
<p class="maintext" id="reviewmain2"></p>
</div>
Here is my current Javascript
$(document).on('ready', function(){
var list = $("#productreviews").find('h4');
list.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list.append('<dd>' + data[idx].nickname + '</dd>');
);
var list2 = $("#productreviews").find('p');
list2.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list2.append('<dd>' + data[idx].review + '</dd>');
);
javascript jquery html json
add a comment |
So I'm trying to load these reviews from a text API I've been given onto a webpage, here are two as an example.
["id":"1","product_id":"scooter","nickname":"James","review":"I'm impressed with the result","rating":"5","id":"2","product_id":"scooter","nickname":"Jerry","review":"Its rubbish","rating":"1"]
There are about 13 in total. To load them into my HTML document, I'm trying to use an ajax function with a loop, then adding the corresponding values into the html file with an append function. I know the javascript code below doesn't work because as none of the reviews have specific identifiers, the code I included pastes all of the review values in every h4 or p item in the html document every time.
My question is how do I fetch the nickname and review items from the API so that they only appear once each on my html document?
Example of where I want 2 reviews to load. The reviewer name in the h4 tag and the review itself within the p tag.
<div id="productreviews">
<img id="reviewimg1" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption1">Good God!!</h3>
<h4 class="idfont idposition" id="reviewuser1"></h4>
<p class="maintext" id="reviewmain1"></p>
<img id="reviewimg2" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption2">Great</h3>
<h4 class="idfont idposition" id="reviewuser2"></h4>
<p class="maintext" id="reviewmain2"></p>
</div>
Here is my current Javascript
$(document).on('ready', function(){
var list = $("#productreviews").find('h4');
list.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list.append('<dd>' + data[idx].nickname + '</dd>');
);
var list2 = $("#productreviews").find('p');
list2.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list2.append('<dd>' + data[idx].review + '</dd>');
);
javascript jquery html json
once your promises are done, you should be doing something with your data. Like injecting it into the DOM
– Chris Hawkes
Mar 27 at 20:52
add a comment |
So I'm trying to load these reviews from a text API I've been given onto a webpage, here are two as an example.
["id":"1","product_id":"scooter","nickname":"James","review":"I'm impressed with the result","rating":"5","id":"2","product_id":"scooter","nickname":"Jerry","review":"Its rubbish","rating":"1"]
There are about 13 in total. To load them into my HTML document, I'm trying to use an ajax function with a loop, then adding the corresponding values into the html file with an append function. I know the javascript code below doesn't work because as none of the reviews have specific identifiers, the code I included pastes all of the review values in every h4 or p item in the html document every time.
My question is how do I fetch the nickname and review items from the API so that they only appear once each on my html document?
Example of where I want 2 reviews to load. The reviewer name in the h4 tag and the review itself within the p tag.
<div id="productreviews">
<img id="reviewimg1" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption1">Good God!!</h3>
<h4 class="idfont idposition" id="reviewuser1"></h4>
<p class="maintext" id="reviewmain1"></p>
<img id="reviewimg2" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption2">Great</h3>
<h4 class="idfont idposition" id="reviewuser2"></h4>
<p class="maintext" id="reviewmain2"></p>
</div>
Here is my current Javascript
$(document).on('ready', function(){
var list = $("#productreviews").find('h4');
list.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list.append('<dd>' + data[idx].nickname + '</dd>');
);
var list2 = $("#productreviews").find('p');
list2.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list2.append('<dd>' + data[idx].review + '</dd>');
);
javascript jquery html json
So I'm trying to load these reviews from a text API I've been given onto a webpage, here are two as an example.
["id":"1","product_id":"scooter","nickname":"James","review":"I'm impressed with the result","rating":"5","id":"2","product_id":"scooter","nickname":"Jerry","review":"Its rubbish","rating":"1"]
There are about 13 in total. To load them into my HTML document, I'm trying to use an ajax function with a loop, then adding the corresponding values into the html file with an append function. I know the javascript code below doesn't work because as none of the reviews have specific identifiers, the code I included pastes all of the review values in every h4 or p item in the html document every time.
My question is how do I fetch the nickname and review items from the API so that they only appear once each on my html document?
Example of where I want 2 reviews to load. The reviewer name in the h4 tag and the review itself within the p tag.
<div id="productreviews">
<img id="reviewimg1" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption1">Good God!!</h3>
<h4 class="idfont idposition" id="reviewuser1"></h4>
<p class="maintext" id="reviewmain1"></p>
<img id="reviewimg2" src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont" id="reviewcaption2">Great</h3>
<h4 class="idfont idposition" id="reviewuser2"></h4>
<p class="maintext" id="reviewmain2"></p>
</div>
Here is my current Javascript
$(document).on('ready', function(){
var list = $("#productreviews").find('h4');
list.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list.append('<dd>' + data[idx].nickname + '</dd>');
);
var list2 = $("#productreviews").find('p');
list2.empty();
var promise = $.ajax('API_link_goes_here');
promise.done(function(data)
for(idx = 0; idx < data.length; idx++)
list2.append('<dd>' + data[idx].review + '</dd>');
);
javascript jquery html json
javascript jquery html json
edited Mar 27 at 20:51
TheGreatHam
asked Mar 27 at 20:08
TheGreatHamTheGreatHam
83 bronze badges
83 bronze badges
once your promises are done, you should be doing something with your data. Like injecting it into the DOM
– Chris Hawkes
Mar 27 at 20:52
add a comment |
once your promises are done, you should be doing something with your data. Like injecting it into the DOM
– Chris Hawkes
Mar 27 at 20:52
once your promises are done, you should be doing something with your data. Like injecting it into the DOM
– Chris Hawkes
Mar 27 at 20:52
once your promises are done, you should be doing something with your data. Like injecting it into the DOM
– Chris Hawkes
Mar 27 at 20:52
add a comment |
1 Answer
1
active
oldest
votes
Here is a snippet of how I tend to accomplish something like this;
- Make an invisible review HTML template
- retrieve and parse the data skipped for snippet functionality
process the data by doing the following for each item;
-cloning the template.
-filling in the clone.
-adding the clone to a placeholder
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid ofvar data
should function as you expect.
– Steve0
Apr 2 at 16:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385636%2fquestion-about-loading-reviews-from-a-text-api-using-jquery%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is a snippet of how I tend to accomplish something like this;
- Make an invisible review HTML template
- retrieve and parse the data skipped for snippet functionality
process the data by doing the following for each item;
-cloning the template.
-filling in the clone.
-adding the clone to a placeholder
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid ofvar data
should function as you expect.
– Steve0
Apr 2 at 16:38
add a comment |
Here is a snippet of how I tend to accomplish something like this;
- Make an invisible review HTML template
- retrieve and parse the data skipped for snippet functionality
process the data by doing the following for each item;
-cloning the template.
-filling in the clone.
-adding the clone to a placeholder
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid ofvar data
should function as you expect.
– Steve0
Apr 2 at 16:38
add a comment |
Here is a snippet of how I tend to accomplish something like this;
- Make an invisible review HTML template
- retrieve and parse the data skipped for snippet functionality
process the data by doing the following for each item;
-cloning the template.
-filling in the clone.
-adding the clone to a placeholder
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
Here is a snippet of how I tend to accomplish something like this;
- Make an invisible review HTML template
- retrieve and parse the data skipped for snippet functionality
process the data by doing the following for each item;
-cloning the template.
-filling in the clone.
-adding the clone to a placeholder
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
var dataString = '["id":"1","product_id":"scooter","nickname":"James","review":"Im impressed with the result ","rating ":"5 ","id ":"2 ","product_id ":"scooter ","nickname":"Jerry ","review":"Its rubbish ","rating ":"1 "]';
$(function()
var data = JSON.parse(dataString);
var $template = $("#template");
//var promise = $.ajax('API_link_goes_here').
//promise.done(function(data)
for (idx = 0; idx < data.length; idx++)
var item = $template.clone();
item.find(".user").text(data[idx].nickname); //set the nickname
item.find(".maintext").text(data[idx].review); //set the review text
item.show(); //toggle the visibility cause the template was hidden
$("#reviews").append(item);
//);
);
#reviews .reviewWrapper
display: block;
width: 50%;
border: 1px solid #ccc;
margin: auto;
margin-top: 5px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='template' class='reviewWrapper' style='display:none'>
<img src="reviewicon1.jpg" alt="An image of a vehicle, a stock
user review image.">
<h3 class="idfont caption">Great</h3>
<h4 class="idfont idposition user"></h4>
<p class="maintext"></p>
</div>
<div>
<div id='reviews'></div>
answered Mar 28 at 16:24
Steve0Steve0
1,8882 gold badges10 silver badges22 bronze badges
1,8882 gold badges10 silver badges22 bronze badges
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid ofvar data
should function as you expect.
– Steve0
Apr 2 at 16:38
add a comment |
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid ofvar data
should function as you expect.
– Steve0
Apr 2 at 16:38
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
Thanks for the help, however I am required to call the review data from the API link and not locally as you have done in the variable datastring.
– TheGreatHam
Mar 28 at 23:45
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid of
var data
should function as you expect.– Steve0
Apr 2 at 16:38
sure, I left your promise commented out. I assumed it was functional and the DOM injection was where the hangup was. uncommenting the promise call to your API and getting rid of
var data
should function as you expect.– Steve0
Apr 2 at 16:38
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385636%2fquestion-about-loading-reviews-from-a-text-api-using-jquery%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
once your promises are done, you should be doing something with your data. Like injecting it into the DOM
– Chris Hawkes
Mar 27 at 20:52