Click here to Skip to main content
14,545,256 members

JavaScript

 
AnswerRe: Easy HTML Editor Pin
Nitin Sawant7-Dec-18 1:57
professionalNitin Sawant7-Dec-18 1:57 
AnswerRe: Easy HTML Editor Pin
RedDk28-Dec-18 11:44
MemberRedDk28-Dec-18 11:44 
GeneralRe: Easy HTML Editor Pin
Bram van Kampen28-Dec-18 12:55
MemberBram van Kampen28-Dec-18 12:55 
QuestionProblems to obtain value "0" or "1" from a div Pin
serenimus1-Dec-18 0:37
Memberserenimus1-Dec-18 0:37 
AnswerRe: Problems to obtain value "0" or "1" from a div Pin
ZurdoDev4-Dec-18 2:27
mveZurdoDev4-Dec-18 2:27 
QuestionUnable to switch events in jquery Pin
vmann30-Nov-18 18:45
Membervmann30-Nov-18 18:45 
SuggestionRe: Unable to switch events in jquery Pin
ZurdoDev4-Dec-18 2:28
mveZurdoDev4-Dec-18 2:28 
QuestionError on line 45 Pin
ghazabaz30-Nov-18 13:38
Memberghazabaz30-Nov-18 13:38 
Hey guys I need some final help with this code. Nothing is showing on the page. Thanks

"use strict";


// This section is supposed to display everything on the page but nothing is showing ?

var gameReport = "<h1>" + itemTitle + "</h1>" +
        "<h2>By:" + itemManufacturer + "</h2>" +
				 "<img src= 'hg_" + itemID + ".png'  alt='" + itemID + "' id= 'gameImg' />" +
				 "<table>" +
				   "<tr><th>Product ID</th><td>" + itemID + "</td></tr>" +
				   "<tr><th>List Price</th><td>" + itemPrice + "</td></tr>" +
				   "<tr>Platform</th><td>" + itemPlatform + "</td></tr>" +
				   "<tr><th>ESRB Rating</th><td>" + itemESRB + "</td></tr>" +
				   "<tr><th>Condition</th><td>" + itemCondition + "</td></tr>" +
				   "<tr><th>Release</th><td>" + itemRelease + "</td></tr>" +
				 "</table>" ;
				  itemSummary;
                 

document.getElementByTagName("article")[0].innerHTML = gameReport;

var ratingSum = 0;

var ratingsCount = ratings.length;

for (var i = 0; i < ratings.length; i++) {
   ratingSum = ratingsCount + ratingSum;
}

var ratingsAvg = ratingSum / ratingsCount;

var ratingReport = "<h1>Customer Reviews</h1> <h2> " + ratingsAvg + "out of 5 stars (" + ratingsCount + "reviews) </h2>";




// This section is giving me an error

for (var i = 0; i <= 2; i++) {


// It says right here "unexpected identifier" 

	ratingReport += "<div class=review><h1>" + ratingTitles + "</h1><table><tr><th>By</th><td>" + ratingAuthors + "</td></tr><tr><th>Review Date</th><td>" +ratingDate+   "</td></tr>" "<tr><th>Rating</th><td>";

					for (var i = 1; i < ratingsAvg.length; i++) {
						ratingReport += '<img src="'+ hg_star.png + '"/>';
					}
					
					ratingReport += "</td></tr</table>" + ratingSummaries + "</div>";
									
}

document.getElementByTagName("aside")[0].innerHTML = ratingReport;


Thanks

modified 1-Dec-18 21:22pm.

AnswerRe: Error on line 45 Pin
ZurdoDev4-Dec-18 2:29
mveZurdoDev4-Dec-18 2:29 
AnswerRe: Error on line 45 Pin
maryam.saboor4-Dec-18 23:54
professionalmaryam.saboor4-Dec-18 23:54 
Questiondata transfer in two dimensional array format Pin
Member 1406088822-Nov-18 20:31
MemberMember 1406088822-Nov-18 20:31 
QuestionRe: data transfer in two dimensional array format Pin
ZurdoDev4-Dec-18 2:29
mveZurdoDev4-Dec-18 2:29 
QuestionJavascript syntax Pin
ghazabaz22-Nov-18 15:48
Memberghazabaz22-Nov-18 15:48 
AnswerRe: Javascript syntax Pin
Graham Breach22-Nov-18 21:36
MemberGraham Breach22-Nov-18 21:36 
AnswerRe: Javascript syntax Pin
NithyaKumarJai25-Nov-18 18:23
MemberNithyaKumarJai25-Nov-18 18:23 
Questionunexpected result function autocomplete() Jquery Pin
serenimus21-Nov-18 7:15
Memberserenimus21-Nov-18 7:15 
AnswerRe: unexpected result function autocomplete() Jquery Pin
Richard Deeming21-Nov-18 8:16
mveRichard Deeming21-Nov-18 8:16 
GeneralRe: unexpected result function autocomplete() Jquery Pin
serenimus22-Nov-18 6:11
Memberserenimus22-Nov-18 6:11 
GeneralRe: unexpected result function autocomplete() Jquery Pin
serenimus22-Nov-18 6:13
Memberserenimus22-Nov-18 6:13 
GeneralRe: unexpected result function autocomplete() Jquery Pin
Richard Deeming22-Nov-18 8:41
mveRichard Deeming22-Nov-18 8:41 
GeneralRe: unexpected result function autocomplete() Jquery Pin
serenimus1-Dec-18 0:19
Memberserenimus1-Dec-18 0:19 
QuestionHello Pin
Member 1406106620-Nov-18 8:15
MemberMember 1406106620-Nov-18 8:15 
QuestionJavascript help Pin
ghazabaz8-Nov-18 15:54
Memberghazabaz8-Nov-18 15:54 
AnswerRe: Javascript help Pin
Richard Deeming9-Nov-18 3:49
mveRichard Deeming9-Nov-18 3:49 
QuestionRe: Javascript help Pin
ghazabaz9-Nov-18 5:55
Memberghazabaz9-Nov-18 5:55 

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.