Seconded on jQuery.

Quote Originally Posted by Dino View Post
I got nothing until I removed the quotes:
Code:
window.onresize = regenerate( );
This causes the alert to fire on page load, but still not on resize in Safari.
It fires there cause you just invoked it right at load time.

The problem wasn't the whitespace - that makes no sense. The problem was the declaration. You should declare all of your JS in the <head>'er. JS in <head> is parsed onready, JS in <body> is parsed onload. It's weird, but in certain cases you can't use something before it's declared when in <body>. It's best to keep head JS and body JS independent of eachother, or use onready/load correctly. In this case, <body onresize=""> wouldn't work because regenerate was declared in the body. Move it up into the head, and it works. Setting window.onresize to the eval string doesn't seem to work period.

You're doing it the correct way now, but all you had to do was move the script tag, it would have worked, however incorrect, see:

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">
    <!-- ...this doesn't seem to work... oh wait it does... -->
        <script type = "text/javascript">
        /*
            ...nor this...
        */
            window.onresize = "regenerate( )";
            function regenerate( )
            {
                alert( "regenerate( )" );
            }
        </script>      
    <body onresize = "regenerate( )" >
  
    </body>
</html>