Forum Moderators: phranque
<script language ="JavaScript" type="text/javascript" src="external.js"></script>
<script type="text/javascript">Function()</script>
Every time I place the "Function()" in the first tag, the function is never passed. It works fine like this but, page validation shows a warning for an empty tag.
Should I being doing something different here?
<script language ="JavaScript" type="text/javascript" src="external.js"></script>
Contains mulitple functions called through out the page.
It is also the line that the "empty tag" warning is reported on. Because there is nothing between <script>and </script>
If I remove the second line
<script type="text/javascript">Function()</script>
This function will not be called. It is actually the function that identifies the browser, screen size, etc, which will return the appropriate style sheet to used.
It is really is not a big deal, because the page is displayed correctly, it's just one of those obnoxious things when you validate a page and you are returned a "warning" for having an empty tag. That's all, and I was wondering if there was a better way of writing it.
Thanks for your help. ;)
It looks to me like your use of the word "Function" is what threw many of us off the trail. I know I initially confused what I now believe you meant as "my_function();" (function invocation) with function { ... }; (function declaration).
This just looks like your validator doesn't recognize external scripts. Maybe you can make it happy with a "//" comment tag between the <script> and </script> tags, or something similar... Or maybe the bug is more subtle, and it might recognize what you want if you swap the "src" declaration and the "type" declaration inside the <script> tag, and give it the "src" first.
What validator are you using?
...Still just guessing but hope this helps.
Jim