Click here to Skip to main content
15,886,806 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Can't set dropdown (option) value in static website after AJAX call Pin
huhuhhuhuh28-Aug-20 3:18
huhuhhuhuh28-Aug-20 3:18 
GeneralJavascript coding question Pin
Member 1492033322-Aug-20 3:49
Member 1492033322-Aug-20 3:49 
GeneralRe: Javascript coding question Pin
GuyThiebaut22-Aug-20 4:44
professionalGuyThiebaut22-Aug-20 4:44 
GeneralRe: Javascript coding question Pin
Richard MacCutchan22-Aug-20 5:01
mveRichard MacCutchan22-Aug-20 5:01 
QuestionHow to edit a page in real time with a CMS? Pin
sakispal17-Aug-20 11:26
sakispal17-Aug-20 11:26 
QuestionLoad Webpage in JS condition Pin
Member 1491620017-Aug-20 7:48
Member 1491620017-Aug-20 7:48 
AnswerRe: Load Webpage in JS condition Pin
ZurdoDev17-Aug-20 10:14
professionalZurdoDev17-Aug-20 10:14 
AnswerRe: Load Webpage in JS condition Pin
Richard Deeming17-Aug-20 21:46
mveRichard Deeming17-Aug-20 21:46 
Member 14916200 wrote:
JavaScript
if(fname > 40);
You have a syntax error in your script. If you check your browser's developer console, you should see an error logged telling you that the else is not expected.

That's because you've got an extra semicolon at the end of your if line, which turns your code into:
JavaScript
if (fname > 40) {
    // Do nothing
}

// Outside of the "if" block now...
window.location.href = "...";

// Invalid "else" statement:
else {
    alert("...");
}
Remove the extra semicolon and your code should work. You should also put braces around the branches:
JavaScript
if (fname > 40) {
    window.location.href = "...";
}
else {
    alert("...");
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

AnswerRe: Load Webpage in JS condition Pin
Otekpo Emmanuel21-Aug-20 4:18
Otekpo Emmanuel21-Aug-20 4:18 
QuestionBeginner-Help with parsing out multi select drop downs Pin
Member 1491294312-Aug-20 8:01
Member 1491294312-Aug-20 8:01 
Questiondrawing-a-polygon-on-image-inside-canvas-after-zoom-in-out-and-panning Pin
Member 1491178110-Aug-20 23:31
Member 1491178110-Aug-20 23:31 
QuestionJquery problem to FIX ! Pin
imothep857-Aug-20 0:25
imothep857-Aug-20 0:25 
Rant[REPOST] Jquery problem to FIX ! Pin
Richard Deeming7-Aug-20 1:00
mveRichard Deeming7-Aug-20 1:00 
AnswerRe: Jquery problem to FIX ! Pin
jkirkerx7-Aug-20 9:28
professionaljkirkerx7-Aug-20 9:28 
QuestionMasking Phone in Ember JS Pin
simpledeveloper24-Jul-20 11:02
simpledeveloper24-Jul-20 11:02 
Questionhow to generate new products, confirm these products are not duplicates from the immediate previous set? Pin
hamzh sami21-Jul-20 10:28
hamzh sami21-Jul-20 10:28 
QuestionHi , can someone help me with this task Pin
Member 1489271418-Jul-20 0:22
Member 1489271418-Jul-20 0:22 
AnswerRe: Hi , can someone help me with this task Pin
Richard MacCutchan18-Jul-20 0:56
mveRichard MacCutchan18-Jul-20 0:56 
JokeRe: Hi , can someone help me with this task Pin
Peter_in_278018-Jul-20 1:34
professionalPeter_in_278018-Jul-20 1:34 
GeneralRe: Hi , can someone help me with this task Pin
Richard MacCutchan18-Jul-20 1:35
mveRichard MacCutchan18-Jul-20 1:35 
QuestionDOM Functions Pin
Member 1488961215-Jul-20 3:09
Member 1488961215-Jul-20 3:09 
AnswerRe: DOM Functions Pin
Richard MacCutchan15-Jul-20 3:49
mveRichard MacCutchan15-Jul-20 3:49 
QuestionPoints Scaling issue on Leaflet Pin
LilFlower13-Jul-20 0:52
LilFlower13-Jul-20 0:52 
AnswerRe: Points Scaling issue on Leaflet Pin
jkirkerx15-Jul-20 12:33
professionaljkirkerx15-Jul-20 12:33 
QuestionJavascript summary with prompt Pin
atomattacker-png11-Jul-20 11:56
atomattacker-png11-Jul-20 11:56 

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.