473,508 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Uppercase or Lowercase?

Hi!

I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?

Jul 26 '06 #1
6 2474
Krij wrote:
Hi!

I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?
There's no text/javascript1.2 or anything like that, as for casing, stick with lowercase and
you're fine :), though it doesn't quite matter for the sake of <scriptbut it may depending on
document DTD used.
Danny
Jul 26 '06 #2

Krij wrote:
Hi!

I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?
The case of tag and attribute names is irrelevant in HTML, it matters
greatly in XML (and hence XHTML).

The case sensitivity of the attribute's value depends on the attribute
- a script element's type attribute is case insensitive.

However, the *value* of the script element's type attribute is
extremely important: any value other than 'text/javascript' will cause
many browsers to ignore the content. You are actually better off to
leave the value empty or not have the attribute at all, in which case
browsers (in most circumstances) will assume JavaScript or JScript
(noting that validators will take exception to missing required
attributes).
--
Rob

Jul 26 '06 #3
Danny wrote:
Krij wrote:
Hi!

I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?

There's no text/javascript1.2 or anything like that,
Yes, there is - there was a version 1.2 of JavaScript which one sees
used from time to time as the value of the (deprecated) language
attribute. Using it there can have serious ramifications depending on
the browser. Using it as the value of the type attribute has possibly
more serious ramifications because it will stop the script content from
being executed at all in some browsers but not others.

Whether one effect is more serious than the other is moot.

as for casing, stick with lowercase and
you're fine :), though it doesn't quite matter for the sake of <scriptbut it may depending on
document DTD used.
The HTML 4 Strict DTD does not define any values for a script element's
type attribute, nor the case of tags or attribute names. HTML 4 is
case insensitive:

<URL: http://www.w3.org/TR/html4/intro/sgmltut.html >

The case sensitivity of attribute values is defined in the HTML
specification, not the DTD.

<URL: http://www.w3.org/TR/html4/interact/...ml#edef-SCRIPT >
--
Rob

Jul 26 '06 #4
RobG skrev:
Danny wrote:
Krij wrote:
Hi!
>
I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?
There's no text/javascript1.2 or anything like that,

Yes, there is - there was a version 1.2 of JavaScript which one sees
used from time to time as the value of the (deprecated) language
attribute. Using it there can have serious ramifications depending on
the browser. Using it as the value of the type attribute has possibly
more serious ramifications because it will stop the script content from
being executed at all in some browsers but not others.

Whether one effect is more serious than the other is moot.

as for casing, stick with lowercase and
you're fine :), though it doesn't quite matter for the sake of <scriptbut it may depending on
document DTD used.

The HTML 4 Strict DTD does not define any values for a script element's
type attribute, nor the case of tags or attribute names. HTML 4 is
case insensitive:

<URL: http://www.w3.org/TR/html4/intro/sgmltut.html >

The case sensitivity of attribute values is defined in the HTML
specification, not the DTD.

<URL: http://www.w3.org/TR/html4/interact/...ml#edef-SCRIPT >
--
Rob
Hi!

Thanks for answering. Yes, of course I meant: '<SCRIPT
TYPE="TEXT/JAVASCRIPT"without the value id.

Had a discussion with my teacher on this subject. He gave me incorrect
answer on a test I did. He meant that lowercase is the recommended way
to go. Couldn't find any in the JavaScript 1.5 book I used so I argued
against :-)

Geir Smevig-Baardsen
MCP
http://www.geirb.info
*******************
*Don't reply to my
*email.
*Reply to group
*:-)
*
*
*******************

Jul 26 '06 #5
RobG said the following on 7/26/2006 1:52 AM:
Krij wrote:
>Hi!

I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?

The case of tag and attribute names is irrelevant in HTML, it matters
greatly in XML (and hence XHTML).
And since 90% of the browsers on the web don't understand xHTML, its not
a big issue is it?
The case sensitivity of the attribute's value depends on the attribute
- a script element's type attribute is case insensitive.
Nor is the mime type people use defined anywhere.
However, the *value* of the script element's type attribute is
extremely important: any value other than 'text/javascript' will cause
many browsers to ignore the content. You are actually better off to
leave the value empty or not have the attribute at all, in which case
browsers (in most circumstances) will assume JavaScript or JScript
(noting that validators will take exception to missing required
attributes).
Aside from the validators, the only UA that *might* get confused by a
<scripttag would be IE and that is in limited circumstances.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 26 '06 #6
Randy Webb skrev:
RobG said the following on 7/26/2006 1:52 AM:
Krij wrote:
Hi!

I wonder: is '<SCRIPT TYPE="TEXT/JAVASCRIPT1.2">' a correct way of
starting? Or should it be kept in lowercase?
The case of tag and attribute names is irrelevant in HTML, it matters
greatly in XML (and hence XHTML).

And since 90% of the browsers on the web don't understand xHTML, its not
a big issue is it?
The case sensitivity of the attribute's value depends on the attribute
- a script element's type attribute is case insensitive.

Nor is the mime type people use defined anywhere.
However, the *value* of the script element's type attribute is
extremely important: any value other than 'text/javascript' will cause
many browsers to ignore the content. You are actually better off to
leave the value empty or not have the attribute at all, in which case
browsers (in most circumstances) will assume JavaScript or JScript
(noting that validators will take exception to missing required
attributes).

Aside from the validators, the only UA that *might* get confused by a
<scripttag would be IE and that is in limited circumstances.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Hi!

And finally a light seems to shine in the horizon. What are we
discussing here?
Of course not JavaScript. JS contains no tags, as I understand. So it
has to be HTML. I pointed this out to my teacher and he finally agreed.
Tags in HTML 4.0 ++ are case insensitive, as another in this thread
pointed out.

Thanks to all :-)

Geir Smevig-Baardsen
MCP
http://www.geirb.info
*******************
*Don't reply to my
*email.
*Reply to group
*:-)
*
*
*******************

Jul 27 '06 #7

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

Similar topics

23
25879
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner,...
8
4301
by: Markus Dehmann | last post by:
My ios::uppercase (and others) seems not to work. #include <iostream> using namespace std; int main(){ int num = 45; cout.setf(ios::hex | ios::showbase | ios::uppercase); cout << "number " <<...
1
3250
by: The_Kingpin | last post by:
Hi all, I need to make a function that convert a string into a certain format. Here what are the restriction: -The first letter of the first and last name must be uppercase. -If a first name...
6
47245
by: BSHELTON | last post by:
How do I convert existing lowercase data to uppercase in Access 2000? I used the following which did not work? UPDATE HousingTowns SET tMunis=UPPER(tMunis); "HousingTowns" is the table name....
2
2723
by: t8ntboy | last post by:
I have a table the contains field called PersonID. Each record in the personID field begins with the letter "p" in uppercase or lowercase. I want to run a query that finds all of the lowercase...
4
2453
by: titan nyquist | last post by:
Why does ToTitleCase not work if the case is already in upper case? I have to make my string lowercase, first, before I pass to to ToTitleCase to have it work. Titan
4
4769
by: jerger | last post by:
i have a great program now with the help of a member from this site, but i need a little customization to meet the needs of non-english speakers... who might accidendtly type punctuation which would...
7
1901
by: tom harrison | last post by:
i'm so glad i found this forum! i have to have some coursework done by the end of the week and i really need it explaining to me. i'm not really that big on stuff like this but it's a part of my web...
9
4835
by: humaid | last post by:
hi guys,i have this problem.first let me show you the so far code #!/user/bin/perl while ($a = <STDIN>) { if ($a =~ tr/A-Z/a-z/) { print "$a\n"; }
1
3225
by: peacock97 | last post by:
I have an access mailing list. I received it in UPPERCASE and have been able to change the 1st letter to UPPERCASE and the rest to lowercase except that in Proper Names like McDonald, McInnis, they...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7135
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...
0
7342
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,...
1
7067
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...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5060
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...
0
4729
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...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.