Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2004, 10:34 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default So lost - HELP -

Hello
I am lost.
When I try to view some website code I noticed there is no body html but just this javascript tag. Can Javascript be used purely to dynamically generate the entire body content or is this a mechanism to hide the source code?
Isn't it more efficient to use ASP.NET?

Am I totally off course? What does this mean? I can't get any answers in the book I got.

Thanks.


<script language="javascript1.1">
<!--
var cmJv="1.1";
//-->
</script>
<script language="javascript1.2">
<!--
var cmJv="1.2";
//-->
</script>
<script language="javascript1.3">
<!--
var cmJv="1.3";
//-->
</script>
<script language="javascript1.4">
<!--
var cmJv="1.4";
//-->
</script>
<script language="javascript1.5">
<!--
var cmJv="1.5";
//-->
</script>
<script language="javascript1.1" src="/coremetrics/v31/techprops.js"></script>

<script language="javascript1.1">
<!--


    cmCreatePageviewTag("home.cfm", "back-end", "", "", "0", "0", "1");

// -->
</script>



 
Old July 22nd, 2004, 11:06 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

JavaScript can be used to dynamically generate the entire body. However, anyone that knows how external .js files work can as good as view the source code, so this is not a method to hide any login information, etc.

The code you have posted seems to be a JavaScript Version Sniffer, which detects which version of JavaScript the browser supports. So, if the browser's max JavaScript level is 1.4, it won't recongnize the language "javascript1.5" and will therefore not execute the code in that tag. So the variable cmJv will equal "1.4", giving you the version.

It is usually better to generate content with a server language like ASP(.NET) because 1) it is commonly faster, 2) the client cannot view any ASP information, and 3) not all browsers have JavaScript enabled, so it would only work on whoever has it enabled.

Hope this clears things up.

Snib

<><





Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Value Getting Lost sid81 .NET Framework 2.0 3 October 13th, 2007 10:15 AM
Lost in Css rodmcleay BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 May 11th, 2007 05:06 AM
Lost in Chapter 8 pjwarez BOOK: Beginning Mac OS X Programming 2 October 21st, 2006 12:10 PM
lost, please help me out... chriswinn Classic ASP Databases 4 January 26th, 2005 03:01 PM
Lost in Chapter 2 kyleridolfo BOOK: Expert One-on-One Access Application Development 0 January 5th, 2005 08:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.