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.

JavaScript Forum


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



Reply
what does this mean? not support JavaScript will display JavaScript as page content?"
Old 09-08-2008, 02:07 AM what does this mean? not support JavaScript will display JavaScript as page content?"
Experienced Talker

Posts: 40
Location: i live with your mom
Trades: 0
I saw the tutorial below on w3 schools website but I don't get the part where it says "Browsers that do not support JavaScript will display JavaScript as page content?" What does that mean I do not understand.

Browsers that do not support JavaScript will display JavaScript as page content.
To prevent them from doing this, and as a part of the JavaScript standard, the HTML comment tag can be used to "hide" the JavaScript. Just add an HTML comment tag <!-- before the first JavaScript statement, and a --> (end of comment) after the last JavaScript statement.
<html>
<body>
<script type="text/javascript">
<!--
document.write("Hello World!");
//-->
</script>
</body>
</html> The two forward slashes at the end of comment line (//) is the JavaScript comment symbol. This prevents JavaScript from executing the --> tag.
meloncrack is offline
Reply With Quote
View Public Profile Visit meloncrack's homepage!
 
 
Register now for full access!
Old 09-08-2008, 02:50 AM Re: what does this mean? not support JavaScript will display JavaScript as page conte
Defies a Status

Posts: 2,071
Name: carl
Location: UK
Trades: 0
Hi

It simply means that if someone surfing the web has Javascript turned off on their web browser then the browser will display the Javascript code on the web page.

Putting the code between the HTML comment tags <!-- Javascript --> hides the script so if Javascript is turned of the browser will ignor it and not display it on the web page. and the // stops JavaScript from trying to execute the --> as code. so it would look like <!-- Javascript //-->
__________________

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

Last edited by bakerc; 09-08-2008 at 02:54 AM..
bakerc is offline
Reply With Quote
View Public Profile Visit bakerc's homepage!
 
Old 09-08-2008, 02:55 AM Re: what does this mean? not support JavaScript will display JavaScript as page conte
Experienced Talker

Posts: 40
Location: i live with your mom
Trades: 0
hi thanks for the reply. So what would be the purpose of having that script inside the <-- Javascript //--> if people do not want it to show why don't they just get rid of it you know? And not even put the <-- Javascript //-->
meloncrack is offline
Reply With Quote
View Public Profile Visit meloncrack's homepage!
 
Old 09-08-2008, 04:09 AM Re: what does this mean? not support JavaScript will display JavaScript as page conte
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
browsers that are javascript enabled will run the script because the will ignore the comments inside the <script...> tags.

If you took it out of the page no user agents at all could possibly run the script.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I 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 09-08-2008, 04:24 AM Re: what does this mean? not support JavaScript will display JavaScript as page conte
Experienced Talker

Posts: 40
Location: i live with your mom
Trades: 0
Oh ok thanks boss.
meloncrack is offline
Reply With Quote
View Public Profile Visit meloncrack's homepage!
 
Reply     « Reply to what does this mean? not support JavaScript will display JavaScript as page content?"
 

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.16865 seconds with 12 queries