Ver código fonte

Move inline script to a script element.

Frederic G. MARAND 9 anos atrás
pai
commit
9afaa106e1
1 arquivos alterados com 8 adições e 3 exclusões
  1. 8 3
      public/index.html

+ 8 - 3
public/index.html

@@ -1,11 +1,16 @@
 <html>
 	<head>
-    <script type="application/ecmascript" src="/lib/jquery-2.2.1.js"></script>
-    <script type="application/ecmascript" src="/index.js"></script>
+    <script type="text/ecmascript" src="/lib/jquery-2.2.1.js"></script>
+    <script type="text/ecmascript" src="/index.js"></script>
+    <script type="text/ecmascript">
+      function sayGoodbye() {
+        $('#title').html('Goodbye');
+      }
+    </script>
 	</head>
 
 	<body>
-    <h1 id="title" onclick="$('#title').html('Goodbye')">
+    <h1 id="title" onclick="sayGoodbye();">
       Hello</h1>
 	</body>
 </html>