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, 06: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, 12:21 PM   #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
Old 11th August 2017, 06:04 AM   #3
charlottegracie
Member
 
charlottegracie's Avatar
 

Join Date: Jan 2017
Location: us
Posts: 6
Default

Thank you for your post..It's very useful to us

charlottegracie 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


Our volunteer moderators and their websites:
David Wallace
SearchRank - Organic Search Engine Optimization
Old Welsh Guy
Internet Marketing from Wales in the UK
torka
NineYards.com: Helping Businesses Do Business Online
Small Business Answers
Free help to grow your business.

New at Search Engine Guide
The 4 Types Of Website Traffic

New at Small Business Answers
Contractor Estimate - Cancel Contract - Bill of Sale - Evaluation Questions

Employee Evaluation Templates
30 Day Review - 90 Day Review - Annual Review - Employee Self Evaluation - Strength & Weaknesses

New at Small Business Forum
Unusual Ways To Promote Your Business

Crimson Fox
Graphic Design and Brand Promotion and the Brand Design Blog
St0n3y
Search Marketing Results - Pole Position Marketing!
Search Marketing Info - (EMP) E-Marketing Performance
Matt McGee
Small Business SEM - Web marketing discussion for small businesses.
Logan
Tiny Doors Frisco
Things To Do

At Your Business - Small Business Directory
Free Business Forms - Prewritten Documents

Free Links - Free Advertising
Free Guide - Online Directory
Debra Mastaler
Alliance-Link
The Link Spiel Blog
ChristineG
Free Online Marketing and Social Media Tips: Social Media Simplified for Small Business Owners
mktgbiz
Promotional Items Marketing
What I REALLY think!


Visit our small business websites
Small Business Forum | Small Business Answers | Search Engine Guide

All times are GMT -5. The time now is 04:03 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004 - 2015 K. Clough, Inc. - Privacy