Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Can I <script ... /> or do I have to </script>? (closing tags)
Old 04-20-2006, 07:23 PM Can I <script ... /> or do I have to </script>? (closing tags)
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
Look at the examples below. Both validates, but do Web browsers and search engines understand them?

HTML Code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<noscript></noscript>
<script type="text/javascript">
_uacct = "UA-82034-6";
urchinTracker();
</script>
<noscript></noscript>
HTML Code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript" />
<noscript />
<script type="text/javascript">
_uacct = "UA-82034-6";
urchinTracker();
</script>
<noscript />
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-20-2006, 07:35 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Well the SEs won't because SEs don't do javascript at all.

for browsers, do both versions record an access in the Analytics log? assuming it's your GA account you can simply test it yourself!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-20-2006, 07:40 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
I've tested. But I'm not sure. Since the stats go up and down all the time anyway.
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Old 04-20-2006, 07:56 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
if you know what time you visit and the IP you are coming from it should be simple to check and correlate.

If you are using IE set the UserAgent string to something unique.
instruction are here

that way you know it was your access and it works.

OR
write a test page with a bit of javascript in it to do the "Hello World" bit and use both forms of the script tag and see which one (or both) works!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-20-2006, 07:57 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
From my own experience, everytime I used self closing <script ... /> tags I had problems. It's better to be safe and explicity close the tags <script></script>

Or maybe it was just me...
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 04-20-2006, 08:11 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
I haven't been able to prove errors with any of ways of closing (exept when I used HTML and not xHTML)...

That's why I'm asking. I'm trying to find out if there's errors to the modern way (.../>).
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Old 04-20-2006, 08:18 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Use <script></script> as Anacrusis suggested, else you may run into problems with some browsers. For example, I know that Opera 9 (beta released today) only just added support for self closing <script /> tags.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 04-20-2006, 08:23 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
I haven't had problems with that on Opera 8.5 for Mac. Are you sure about that?
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Old 04-20-2006, 08:25 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
According to the changelog (link to Windows changelog, but also appears on Mac).
Quote:
Allowed self closing SCRIPT tags in HTML documents.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 04-20-2006, 09:49 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
I use Opera 8.5 on windows almost exclusivly and like I stated previously, it always gave me trouble when I used self closing script tags. Never tried it in any other browser.
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 04-21-2006, 05:44 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Wen using <script>code</script> it validates in both html 4.01 and in xhtml.

Why would you need to worry about the self closing tag.

Sounds like a moo point to me. You know, like a cows opinion!

Also, why use a self-closing noscript tag? if your not going to use the tag, why have it on the page. A page will validat without it I believe.. Correct me if I am wrong.

I guess a good reason for why presupposes whether I am willing to spend ten minutes or an hour for research.

Is there a reason that you wanted to use a self closing tag Moldarin?

just because i was curious only gets ten minutes..
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 04-21-2006, 05:52 PM Re: Can I <script ... /> or do I have to </script>? (closing tags)
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
I add a selfclosing <noscript /> (or should I use <noscript></noscript>?) tag after the Google analytics script to tell browsers that this content have no value if JavaScript isn't enabled.

And I just LIKE self closiong the script. Think it would be better... Just look at it: what whould you prefer?

<script ...></script>
<script ... />
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can I <script ... /> or do I have to </script>? (closing tags)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53947 seconds with 12 queries