473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

direct javascript deprecated?

At http://www.quirksmode.org/js/placejs.html
I found a discussion on how & where to place your javascript.

Toward the bottom of the page, PPK has a section titled Deprecated:
Direct JavaScripts, with a small blurb that says "Do not use direct
JavaScripts. This section is only maintained for historical reasons."

For clarity, he is referring to a practice like:

<script type="text/javascript">
// Some javascript here
</script>

So - this is deprecated? This is something that shouldn't be done?

I can think of many instances where this would be the only way to
accomplish some things, and at least a few where it is a preferable
solution to loading & executing a script from an external file.

So - is this really deprecated? Or is the information presented
innacurate? Or perhaps something in between?
Apr 12 '06 #1
3 2816
VK

Tony wrote:
At http://www.quirksmode.org/js/placejs.html
I found a discussion on how & where to place your javascript.

Toward the bottom of the page, PPK has a section titled Deprecated:
Direct JavaScripts, with a small blurb that says "Do not use direct
JavaScripts. This section is only maintained for historical reasons."


That is a la W3C text (by style, not by origin). I mean it is not
enough to read it: you need also decrypt the intended sense out of bad
wording and typos.

Of course <script> is not deprecated.

The relevant section is called "Deprecated : Direct JavaScripts", and
the note referes to the section's title. Must read:
"Do not use "Direct JavaScripts" recommendations for <script> tag
syntax. This section is only maintained for historical reasons."

In this form it is correct, because this legacy part refers to the
"language" attribute and the "hide the script" comment trick.

P.S. Overall <http://www.quirksmode. org> is good source of info; it
suffers a bit of standards' maximalism and "Micro$oft must die!" stuff,
but the overall quality of materials is high.

Apr 12 '06 #2
On 12/04/2006 19:21, Tony wrote:
At http://www.quirksmode.org/js/placejs.html
[snip]
<script type="text/javascript">
// Some javascript here
</script>

So - this is deprecated? This is something that shouldn't be done?
The exact code that's demonstrated is deprecated; it features the
language attribute and SGML comments. However, I agree that that doesn't
appear to be the focus of the term 'deprecated'.

No, embedded scripts are not deprecated, however I do support the
sentiment of using external files where practical, especially for large
or reusable code.

[snip]
Or is the information presented innacurate? Or perhaps something in
between?


It's certainly inaccurate in some respects, but it seems to suffer more
from age than anything else. The information in the FAQ Notes[1] is most
definitely better.

Mike
[1] <http://www.jibbering.c om/faq/faq_notes/script_tags.htm l>

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Apr 12 '06 #3
VK wrote:

That is a la W3C text (by style, not by origin). I mean it is not
enough to read it: you need also decrypt the intended sense out of bad
wording and typos.

Of course <script> is not deprecated.

The relevant section is called "Deprecated : Direct JavaScripts", and
the note referes to the section's title. Must read:
"Do not use "Direct JavaScripts" recommendations for <script> tag
syntax. This section is only maintained for historical reasons."

In this form it is correct, because this legacy part refers to the
"language" attribute and the "hide the script" comment trick.
Ah - that makes more sense, then :) It didn't come across quite that
clearly, and I'm used to getting good info from PPK
P.S. Overall <http://www.quirksmode. org> is good source of info; it
suffers a bit of standards' maximalism and "Micro$oft must die!" stuff,
but the overall quality of materials is high.


I have found it to be a very useful resource
Apr 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2017
by: annon | last post by:
I've noticed that some problems come up frequently that are of importance in writing web pages, because they're pretty fundamental points. For general reference, here are some collected solutions. 1. Opens a new Window at maximum size: window.moveTo(0,0,screenX=0,screenY=0) window.resizeTo(screen.availWidth+2,screen.availHeight+6)
6
1949
by: Mark Pappert | last post by:
I've got a linked 'common.js' file that contains one function, on IE and Firefox everything works as expected. However, Opera generates the following error: http://www.mdocs.ca/scripts/common.js Unknown context Syntax error while loading (line 61) -^
2
7418
by: Cy | last post by:
Hi, I have a menu that toggles correctly in IE but is failing in FireFox V.1 and Netscape 7.1. The FireFox JavaScript Console is returning the following error; Error: document.getElementById(showDiv) has no properties. Any advice would be much appreciated. Here is the snippet of applicable code; <script language="javascript">
7
1853
by: JSNewbie | last post by:
I am new to javascript. I used the code below in Netscape 7.0 and in IE 6.0. The Javascript portion does not render in Netscape , but it does show in IE. Can someone explain why? Any helpful insight would be appreciated. <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html xmlins="http://www.w3.org/1999/xhtml"> <head>...
1
3841
by: jarit | last post by:
Hi, Found these coding guidelines for C#, HTML, Javascript, Java, HTML, PL/SQL, T-SQL, VB and VBScript. Well written and free to download. www.demachina.com/products/swat Jeroen
3
5708
by: mbasil7 | last post by:
Hi at all! I want to use a javascript variable in php. The reason is that i want to know the client's screen resolution. Keep in mind that i am not a javascript programmer but php. Here is the code i'm using: <head> <script language='JavaScript'>
5
9456
by: Nadav | last post by:
Hi, I am trying to get a direct pointer to the address of the screen ( something like 0x0b00 in the happy DOS days ), how can I do that? Should this be done in the kernel or it can also be done in the App layer? Is there a contant base address to the screen memory? What API should I use? ThanX Nadav
7
4505
by: Jean Pierre Daviau | last post by:
I tried this in iexplorer, mozilla, opera. var in = 1; switch( in ){ case 1: in = "-1-"; break; case 2:
78
3348
by: Jeremy J Starcher | last post by:
(Request for Discussion) I've put together a guide that I hope will help novice coders avoid the same hair pulling that I went through. I'm open for comments about it. Have I missed the mark on a point or two? Have I overlooked something? Is my basic goal flawed? Is code bad in so many different ways that I
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.