0
The Javascript code below should display an alert window with the phrase "Hello World!" when the index.html page was loaded, but this does not happen... Page content loads, but the function does not execute.
var main = function () {
'use strict';
alert("Hello World!");
};
$(document).ready(main);
Someone would know to tell me what’s wrong with her?
var main = function () {
'use strict';
alert("Hello World!");
};
window.onload = main;
<!DOCTYPE html>
<html>
<head>
<title>A Simple App</title>
<link rel="stylesheet" href="style.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header>
</header>
<section class="comment-input">
<p>Add Your Comment:</p>
<input type = "text"><button>+</button>
</section>
<section class="coments">
<p>This is the first comment!</p>
<p>Here's the second one!</p>
<p>And this is one more.</p>
<p>Here is another one.</p>
</section>
<script scr="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script scr="app.js"></script>
</body>
</html>
Just a reminder, the title of the question has nothing to do with anything, much less the problem... try to apply a title that clarifies the problem at hand.
– Zuul
The question is this why I want to know... I don’t know much about javascript and still don’t know very well what I’m doing...
– Van Ribeiro
Do you know you’re using jQuery? It was your intention?
– Maniero
yes, I loaded jQuery 2.1.3... I will post the code I used in html...
– Van Ribeiro
scr
should besrc
... comes from source in English. That is, where you have<script scr=
, mute to<script src="
– Zuul
Yes, now it worked... Thank you very much!... _ Sorry for the silly doubt... but like I said, I don’t know much about javascript... :/
– Van Ribeiro