Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 22nd, 2004, 10:34 AM
Friend of Wrox
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default So lost - HELP -

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.


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

<script language="javascript1.1">

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

// -->

Reply With Quote
  #2 (permalink)  
Old July 22nd, 2004, 11:06 AM
Friend of Wrox
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts

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.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 08:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.