Welcome to the Small Business Ideas Forum! We are a community of over 100,000 small business folks with over 163,000 posts for you to browse. We pride ourselves on being the friendliest forum you will find and we'd love to have you as a member of our community. Please take a moment and register for a free account. If you need any help, please contact Chris Logan.

Small Business Ideas Forum

Small Business Ideas Forum

A friendly place to share small business ideas and knowledge, ask questions, find help and encourage others that are involved in the small business industry. Topics include small business marketing, generating revenue and small business computing.

Go Back   Small Business Ideas Forum > Small Business Computing > Website Development
Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 11th August 2004, 05:53 PM   #1
StupidScript
Administrator
 
StupidScript's Avatar
 

Join Date: Jul 2004
Location: Los Angeles
Posts: 604
Default HTML4.0 and Javascript

[Comment moved from SEO Checklist by StupidScript]

About the only thing the HTML4 DTD has to do with Javascript is the way the <script> tag is written. Javascript is a separate technology (developed by Netscape and not related to Sun's Java except for marketing reasons).

The tag should look like one of these, when it's finished:

<script language="javascript" type="text/javascript">
functions andStuff() {
}
</script>

--- or ---

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

--- or ---

<script language="javascript" type="text/javascript" src="site.js" defer=1></script>

(The last one tells the browser that you won't be using Javascript to write anything on the page ( i.e. document.write() ) so it can go ahead and render the page without waiting.)

Sometimes you see the version of Javascript in the "language" attribute ( i.e. language="Javascript1.2" ), but it makes no difference to the browser. In fact, the "language" attribute is deprecated in favor of the "type" (MIME-type) attribute, and is only included for backwards compatibility.

If a browser is having trouble rendering the menu, it's probably the browser. If it's your composition tool, then it's probably the tool reacting to the DTD as if it mattered to the script.

Perhaps your script writes non-conforming elements, so it's not the script, per se, but what you are doing with it that doesn't meet the spec.

After you're done editing in your composition program, check the syntax in, say Notepad or SimpleText to see the real deal, and adjust as necessary.

(See: http://www.w3c.org/TR/REC-html40/interact/scripts.html section 18.2.1 for the full <script> definition.)

__________________
James Butler - "Do no weevils"
JamesButler.net
MusicForHumans.com
StupidScript is offline   Reply With Quote
Register or log in to remove this ad.
Old 23rd August 2004, 11:21 AM   #2
StupidScript
Administrator
 
StupidScript's Avatar
 

Join Date: Jul 2004
Location: Los Angeles
Posts: 604
Default

I have recently been corrected regarding the syntax of the SCRIPT tag and its "defer" attribute.

While my original posting is technically correct, given a strict reading of the W3C standard, it does not meet the XML standard.

There are several discussions going on regarding exactly how to implement this attribute, including whether to use "defer" or "true" as the value of the attribute, however I have come up with yet another interpretation which I'm going to stand by...until further corrections are necessary.

Here is my take on implementing the "defer" attribute in a SCRIPT tag:

<script language="javascript" type="text/javascript" src="site.js" defer>
</script>

The presence of the attribute triggers the deferral. In the W3C spec, there is no value indicated, rather that the "defer" attribute is itself a boolean attribute, and including it as I have, above, sets its value to "true" or "1", while omitting the attribute sets its value to "false" or "0".

IMHO.

__________________
James Butler - "Do no weevils"
JamesButler.net
MusicForHumans.com
StupidScript is offline   Reply With Quote
Reply   

Bookmarks




Thread Tools

Get Updates
RSS Feeds:
RSS Feed for Website Development RSS for this Category Only: Website Development

RSS Feed for Small Business Ideas Forum RSS for Entire Forum
Forum Rules


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Small Business Ideas Forum


 
At Your Business - Small Business Directory
Free Business Forms - Prewritten Documents
 
Search Engine Guide
Small business guide to search marketing

 
Small Business Brief
Fetching the Best Small Business Info


Free Links - Free Advertising
Free Guide - Online Directory



Advertise your business here
Contact us for more details!


Semantic Juice
Register now to access free Quick SEO service!


Rocket Lawyer
Sign up for free 7 day trial. Boost your biz!


Buy UPC Codes
Get your products listed online!




All times are GMT -5. The time now is 04:23 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004 - 2018 - Privacy