1

I have a simple test page which seems to be working in Chrome but Not in Firefox.

The HTML Code is:

<html>
   <head>
      <title>Test Title</title>
   </head>

   <body>
      <script scr="test.js"> </script>

      <h1> Test </h1>
   </body>
</html>

The JavaScript code is:

alert("Hello World");
alert("Hello World");  
alert("Hello World");

Thanks in advance,

3
  • There is no difference between firefox and chrome when it comes to the alert functionality. Maybe chrome blocks multiple popups? Whats the result you are seeing? Absolutely nothing in Firefox? Commented May 27, 2016 at 8:39
  • 1) which version? 2) In which one dosen't work? Commented May 27, 2016 at 8:40
  • 5
    script scr ==> script src Commented May 27, 2016 at 8:40

1 Answer 1

3

First of all your script elements source property got a typo and I would always use the MIME-Type info. try:

<script type="text/javascript" src="test.js"></script>

Furthermore, script definitions aswell as css links etc. should normaly be placed in the <head> section of your html document, not in the <body>

EDIT:

Actually the script MIME-Type is kinda deprecated and is not needed anymore. However, it does no harm if left in there.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.