SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    works on ie, not firefox

    I've cleared the cache in firefox 21.0, but the following excerpt does not display anything in firefox, but works as expected in ie.
    (The script is to remind my wife to turn off the printer when she completes her session.)
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    	<title>Special Event Recap lessons</title>
    	<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    	<meta name="description" content="Lesson Summary Worksheet" />
    	<meta name="robots" content="noindex, nofollow" />
    	<link rel="shortcut icon" href="..." />
    	<link rel="stylesheet" type="text/css" href="..." media="screen" />
    	    <link rel="stylesheet" type="text/css" href="..." media="screen" />
      <script language="javascript">
    		function reminder() {
    			alert("Please remember to shut off printer");
    		}
    	</script>
    </head>
    <body onunload="reminder()">
    ...
    Thoughts?

    regards,

    grNadpa

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,607
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    I suggest you validate your HTML as the first step. That will tell you where all the HTML errors are - such as language="javascript" - so that you can correct them.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you. Figured it was something simple. And, you are right, I should have re-validated the code I pulled from the tutorial. I didn't. And justly deserve stricture.

    However, replacing "language" with "type", while it did render the w3c html validator to declare "This document was successfully checked as XHTML 1.0 Strict!", did not resolve my problem: firefox still does not fire the alert on closing the window.

    (Verified through ctrl-u that the code was the most recent.)

    At this point, I don't need the aggravation, so will live without it.

    Thank you all for taking a look at it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •