473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ASP scripting language query

Hello

Are the 3 script tags below all client-side javascript? If not, what are
they? If they are client-side javascript, why the different syntax (ie.
<SCRIPT>,
<SCRIPT LANGUAGE="JavaScript1.2">, <SCRIPT LANGUAGE="JavaScript">)?

Also, the syntax <%@ language=.... %> has been ommitted. Why is this, i
thought this was not allowed? Thanks

<SCRIPT>
function transform_url()
{
var suppress_host = false;

// an array to facilate searching of URL arguments
// callee wishes to preserve
var preserve = new Array;

// 'id' is a parameter we preserve by default
preserve['id'] = true;

// enumerate the array with arguments
for (i = 0; i < arguments.length; i++)
{
if (arguments[i] == 'SuppressHost')
suppress_host = true;
else
preserve[arguments[i]] = true;
}

// start constructing new URL
newurl = new String;
with (location)
{
if (suppress_host)
newurl += pathname.substr(1);
else
newurl += protocol + '//' + hostname + pathname;
}

// process the URL parameters
// string the leading '?' character if it exists
var parameters = (location.search.substr(0, 1) == '?') ?
location.search.substr(1) : location.search;
var params = parameters.split('&');
for (i = 0; i < params.length; i++)
{
nvpair = params[i].split('=');
if (nvpair.length >= 1) // check for valid name/value pair
{
if (preserve[nvpair[0]])
{
// append this parameter if callee
// specified it to be preserved
newurl += '_' + nvpair[0] + ((nvpair.length == 2) ? ('=' +
nvpair[1]) : '');
}
}
}

return newurl;
}

</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
var wtl_imgarray = new Array;
var wtl_ptr = 0;
function wtl_Tag6(wtl_TagID,wtl_SID,wtl_URL,wtl_Title,CONTE NTGROUP)
{
function wtl_createImage(wtl_src)
{
if (document.images)
{
wtl_imgarray[wtl_ptr] = new Image;
wtl_imgarray[wtl_ptr].src = wtl_src;
wtl_ptr++;
}
}
function D8( d)
{
var fwd=1, seed= new Date('01/01/2000'), key=
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyz";
var s= key.charAt( d.getFullYear()-2000)+key.charAt(
d.getMonth()+1)+key.charAt( d.getDate());
s+= key.charAt( d.getHours())+key.charAt( d.getMinutes())+key.charAt(
d.getSeconds());
while( seed.getDay()!=fwd) seed= new Date(seed.getTime() + 86400000);
var w= Math.floor( (d.getTime()-(seed.getTime()+86400000)) / 604800000 );
s+= key.charAt( (w-(w%16))/16 );
s+= key.charAt( w%16);
return s;
}
function A( B, C)
{
W+="&"+B+"="+escape(C);
}
var t = new Date();
var
W="http"+(window.location.protocol.indexOf('https: ')==0?'s':'')+"://statse.webtrendslive.com/S"
+ wtl_SID + "/button6.asp?tagver=" + wtl_TagVer + "&si=" + wtl_TagID + "&fw="
+ wtl_FWD;
A( "server", typeof(SERVER)== "string" ? SERVER : "");
A( "order", typeof(ORDER)== "string" ? ORDER : "");
A( "Group", typeof(CONTENTGROUP)== "string" ? CONTENTGROUP : "");
A( "invoice", typeof(INVOICE)== "string" ? INVOICE : "");
A( "cartview", typeof(CARTVIEW)== "string" ? CARTVIEW : "");
A( "cartadd", typeof(CARTADD)== "string" ? CARTADD : "");
A( "cartremove", typeof(CARTREMOVE)== "string" ? CARTREMOVE : "");
A( "checkout", typeof(CHECKOUT)== "string" ? CHECKOUT : "");
A( "cartbuy", typeof(CARTBUY)== "string" ? CARTBUY : "");
A( "adcampaign", typeof(ADCAMPAIGN)== "string" ? ADCAMPAIGN : "");
A( "tz", t.getTimezoneOffset());
A( "ch", t.getHours());
A( "cl", D8(t));
A( "ti", wtl_Title);
A( "url", wtl_URL);
A( "rf", window.document.referrer);
A( "js", "Yes");
A( "ul", navigator.appName=="Netscape" ? navigator.language :
navigator.userLanguage);
if(typeof(screen)=="object")
{
A( "sr", screen.width+"x"+screen.height);
A( "cd", screen.colorDepth);
A( "jo", navigator.javaEnabled() ? "Yes" : "No");
}
if( W.length>2048 && navigator.userAgent.indexOf('MSIE')>=0)
W= W.substring( 0, 2043)+"&tu=1";
wtl_createImage(W);
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
var wtl_TagVer = 6;
var wtl_FWD = 0;
var wtl_url = transform_url('vlnk','more','all');
var wtl_title = document.title;
var wtl_TagID = 139171;
var wtl_SID = "139171";
var ORDER= "";
var SERVER= "";
var CONTENTGROUP= "NS- Dataset, " +
transform_url('SuppressHost','vlnk','more','all');
var INVOICE= "";
var CARTVIEW= "";
var CARTADD= "";
var CARTREMOVE= "";
var CHECKOUT= "";
var CARTBUY= "";
var ADCAMPAIGN= "";
wtl_Tag6(wtl_TagID,wtl_SID,wtl_url,wtl_title,CONTE NTGROUP);
//-->
</SCRIPT>
Jan 24 '06 #1
5 1995
> <SCRIPT>
function transform_url()
...
</SCRIPT>
That's client-side script. Language is unspecified, which is a pretty bad
practice.

<SCRIPT LANGUAGE="JavaScript1.2">
That's specifiying the version of Javascript. If an old browser loads this,
it'll decide, "I don't know what 'Javascript1.2' is, so I'll just ignore
this."

<SCRIPT LANGUAGE="JavaScript"> That's just specifying Javascript without worrying about the version.
Unless you're writing stuff that's only available in certain versions of
Javascript, this is generally fine to use, although the more encouraged way
of doing it is:

<script type="text/javascript">
</script>

The ommission of <%@ Language... thing. Well, that has nothing to do with
the CLIENT-SIDE javascript you asked about. But, as far as ommitting that,
that's fine to do, as the page will use the default language that's defined
in IIS, which is VBScript in a default configuration.

In the future, feel free to trim away the four hundred million lines and a
half of javascript when you're asking only about the <script> tags.

Ray at work

"Placek" <Pl****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com... Hello

Are the 3 script tags below all client-side javascript? If not, what are
they? If they are client-side javascript, why the different syntax
(ie.
<SCRIPT>,
<SCRIPT LANGUAGE="JavaScript1.2">, <SCRIPT LANGUAGE="JavaScript">)?

Also, the syntax <%@ language=.... %> has been ommitted. Why is this, i
thought this was not allowed? Thanks

<SCRIPT>
function transform_url()
...
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">

Jan 24 '06 #2
Ray

Appreciate your response.....will chop away uneeded code next time. You
say ommitting <%@ language=.... %> defaults to vbscript.....does this mean
the first script in my post is client-side vbscript?

Thansk

"Ray Costanzo [MVP]" wrote:
<SCRIPT>
function transform_url()
...
</SCRIPT>


That's client-side script. Language is unspecified, which is a pretty bad
practice.

<SCRIPT LANGUAGE="JavaScript1.2">
That's specifiying the version of Javascript. If an old browser loads this,
it'll decide, "I don't know what 'Javascript1.2' is, so I'll just ignore
this."

<SCRIPT LANGUAGE="JavaScript">

That's just specifying Javascript without worrying about the version.
Unless you're writing stuff that's only available in certain versions of
Javascript, this is generally fine to use, although the more encouraged way
of doing it is:

<script type="text/javascript">
</script>

The ommission of <%@ Language... thing. Well, that has nothing to do with
the CLIENT-SIDE javascript you asked about. But, as far as ommitting that,
that's fine to do, as the page will use the default language that's defined
in IIS, which is VBScript in a default configuration.

In the future, feel free to trim away the four hundred million lines and a
half of javascript when you're asking only about the <script> tags.

Ray at work

"Placek" <Pl****@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
Hello

Are the 3 script tags below all client-side javascript? If not, what are
they? If they are client-side javascript, why the different syntax
(ie.
<SCRIPT>,
<SCRIPT LANGUAGE="JavaScript1.2">, <SCRIPT LANGUAGE="JavaScript">)?

Also, the syntax <%@ language=.... %> has been ommitted. Why is this, i
thought this was not allowed? Thanks

<SCRIPT>
function transform_url()
...
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">


Jan 24 '06 #3
Placek wrote:
Ray

Appreciate your response.....will chop away uneeded code next time.
You say ommitting <%@ language=.... %> defaults to vbscript.....does
this mean the first script in my post is client-side vbscript?


No. The <%@ tag applies to server-side code. Leaving out that tag means that
the language in server-side code will be expected to be vbscript (the
default unless a configuration setting is changed at the web site level
using IIS Mgr). The default for client-side code is typically javascript
unless otherwise specified.

Server-side code is enclosed in <% ... %> tags or contained in a
<script runat=server> ... </script> block. Anything else is client-side
code.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jan 24 '06 #4
Ray Costanzo [MVP] wrote:
<SCRIPT LANGUAGE="JavaScript1.2">
That's specifiying the version of Javascript. If an old browser
loads this, it'll decide, "I don't know what 'Javascript1.2' is, so
I'll just ignore this."

<SCRIPT LANGUAGE="JavaScript">

That's just specifying Javascript without worrying about the version.
Unless you're writing stuff that's only available in certain versions
of Javascript, this is generally fine to use, although the more
encouraged way of doing it is:


Interesting piece of trivia here, Ray.

When Netscape implemented Javascript 1.2, they introduced a nasty bug. The
equality operator would substitute for the assignment operator in
conditionals:

if (a=b) // treated like: if (a==b)

That bug was fixed in 1.3.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jan 24 '06 #5
Good Lord. You'd think that in testing a new version of a language, someone
may have used "if" once or twice. :]

Ray at work

"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Interesting piece of trivia here, Ray.

When Netscape implemented Javascript 1.2, they introduced a nasty bug. The
equality operator would substitute for the assignment operator in
conditionals:

if (a=b) // treated like: if (a==b)

That bug was fixed in 1.3.

Jan 25 '06 #6

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

Similar topics

4
by: The_Incubator | last post by:
As the subject suggests, I am interested in using Python as a scripting language for a game that is primarily implemented in C++, and I am also interested in using generators in those scripts... ...
41
by: Richard James | last post by:
Are we looking at the scripting world through Python colored glasses? Has Python development been sleeping while the world of scripting languages has passed us Pythonista's by? On Saturday...
33
by: Quest Master | last post by:
I am interested in developing an application where the user has an ample amount of power to customize the application to their needs, and I feel this would best be accomplished if a scripting...
9
by: Vijai Kalyan | last post by:
Hello All, I have a few questions which you might seem irrelavant and/or foolish. I am asking anyway so I can find out. 1. Is XSL as powerful as a programming language such as Java in its...
19
by: Shailesh Humbad | last post by:
Has anyone ever heard of a c++ web 'scripting' engine? I think it would be fairly easy to make one. All that is needed is an intermediary that compiles the code on demand and caches the...
3
by: Michal O | last post by:
Hi. I have to write a C++ code that invokes a set of SQL statements (inserts, updates, selects etc.), according to the system administrator's directives. The directives should be written as a...
6
by: RM | last post by:
This is from the new KOffice Announcement. http://www.koffice.org/announcements/announce-1.5.php '''This version of KOffice features a start of a unified scripting solution called Kross. Kross...
4
by: Gene Jones | last post by:
So I'm starting to do some things where I'm going to want to add scripting in the application, and I can't find a scripting language to plug in that I like. So far I've looked at LUA and L-Sharp,...
2
by: JosAH | last post by:
Greetings, Introduction Java is not Javascript and most of the times when questions end up in the wrong forum, they're moved to the other forum as soon as possible. Accidentally this article...
3
Banfa
by: Banfa | last post by:
The project I work on has a bespoke hardware platform which is designed to go into a variety of different situations. However to keep things simple we really want the software for the platform to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.