Champion Champion - 3 months ago 17
HTML Question

Alert Box works in one way not in other Way

When I write this Piece of code the Alert Box do not appear -

$(document).ready(function() {
alert('Welcome to StarTrackr! Now no longer under police
investigation!);
});


But when I write this piece of Code the Alert box appears =

$(function() {
alert('Ready to do your bidding!');
});


What could be the reason?

Answer

You need to close the string in your first alert box. You can see the syntax is highlighting the entire section.

$(document).ready(function() {
alert('Welcome to StarTrackr! Now no longer under police investigation!');
});
Comments