If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > diff between <% %> and <SCRIPT...> ????

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-03, 03:05
KewellMagic KewellMagic is offline
Registered User
 
Join Date: Sep 2003
Location: Australia
Posts: 7
diff between <% %> and <SCRIPT...> ????

Hi

Hope this question isn't too basic - please help anyway!

I am to make a little web application using ASP.

What is the difference between declaring VBScript in <% here %> and <SCRIPT LANGUAGE="VBSCRIPT> here </SCRIPT> ??

I can't tell but I get differing degrees of success when I code with either of them.
Reply With Quote
  #2 (permalink)  
Old 11-09-03, 05:46
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
Re: diff between <% %> and <SCRIPT...> ????

server side / client side respectively

Quote:
Originally posted by KewellMagic
Hi

Hope this question isn't too basic - please help anyway!

I am to make a little web application using ASP.

What is the difference between declaring VBScript in <% here %> and <SCRIPT LANGUAGE="VBSCRIPT> here </SCRIPT> ??

I can't tell but I get differing degrees of success when I code with either of them.
Reply With Quote
  #3 (permalink)  
Old 11-09-03, 12:06
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Exclamation

Also remember... when using ASP it is really easy to assume that "the client is using Microsoft Windows(R), Of Course." Microsoft would love for you to assume that, but it's not a safe assumption; not at all.

When designing applications for the web, I strive to produce systems that require as little client-side programming as possible; that's usually "none at all." This is what creates a truly portable application, hence the greatest number of potential customers who can actually use the site.

The world is full .. and always will be .. of "non Windows" platforms, and plenty of competitors are just a click away from your own URL. Obviously this does not apply so much when you're building an internal-only (intranet) application, but even in that case I think that this way of thinking produces better, longer-lasting code.
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
  #4 (permalink)  
Old 11-09-03, 18:36
KewellMagic KewellMagic is offline
Registered User
 
Join Date: Sep 2003
Location: Australia
Posts: 7
thanks guys

anyone know of an online resource that explains how to mix client-side and server-side VBscript on the one page?


sundial: I would try another way but this project has specifically asked for use of client and server side code using VBscript only
Reply With Quote
  #5 (permalink)  
Old 11-09-03, 20:57
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Cool

Quote:
Originally posted by KewellMagic
thanks guys
sundial: I would try another way but this project has specifically asked for use of client and server side code using VBscript only
Thou $halt Do What Thy Cu$tomer Want$!
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
  #6 (permalink)  
Old 11-14-03, 05:36
saberint saberint is offline
Registered User
 
Join Date: Nov 2003
Location: Australia
Posts: 4
Re: diff between <% %> and <SCRIPT...> ????

Simple,
<% depicts the opening of server side code %> is the end of server side code
.... of course this
<%@ Language="VBSCRIPT" %>
defines the language of the ASP page and must be at the top of the page (but not under .net(u can have multiple instances with .net))

<SCRIPT LANGUAGE="VBSCRIPT> here </SCRIPT>

is client side
(y would any1 want to use vbscript in a web browser? Javascript is much better there....

to chop and change between the 2 modes (client server) u just use <% and %>

eg (sorry this example is in jscipt, but for the sake of showing client/server integration, it is exactly the same

<%@ Language="JScript" %>
<%

%>
<HTML>
<HEAD>
<TITLE>CSV to graphics</TITLE>
</HEAD>

<BODY>
<%
// need to set key word searches and the location within the arrray.....in other
// words the column number minus 1 (it is an javascript array after all)
$location =2
z=0;
$key_words = new Array()
$key_words[0]="approve";
$key_words[1]="cleared";
// of course some kind of counting system must be added and set to 0
$key_words_score = new Array()
$key_words_score[0]=0;
$key_words_score[1]=0;
var $data;
var data_array = new Array();
fso = new ActiveXObject("Scripting.FileSystemObject");
$doc="C:/Inetpub/wwwroot/csv/dummy.csv"
file = fso.OpenTextFile($doc, 1, true);
while (!file.AtEndOfStream)
{
$data=file.ReadLine();
data_array = $data.split(",");
i=0;
while (i!= $key_words.length)
{
if(data_array[$location].search($key_words[i])!=-1){$key_words_score[i]+=1}
i++
}
z++;
}

i=0;
total=0;
graphic_data="height=400&width=500&label=y&legend= y&3d=y";
while (i!= $key_words.length)
{
graphic_data+="&"+$key_words[i]+"="+$key_words_score[i]
total+=$key_words_score[i]
i++
}
graphic_data+="&Unaccountable="+(z-total)
%>
<br><br>
<table width=100% cellpadding=5 cellspacing=5 border=0 ID="Table1">
<tr><td><img id="graph" name="graph" src="graphics/bar.ashx?<%=graphic_data%>"></td></tr>
<tr><td><img id="Img1" name="graph" src="graphics/plot.ashx?<%=graphic_data%>"></td></tr>
<tr><td><img id="Img2" name="graph" src="graphics/pie.ashx?<%=graphic_data%>"></td></tr>
<tr><td><img id="Img3" name="graph" src="graphics/piethreed.ashx?<%=graphic_data%>"></td></tr>
</table>


<%
file.Close();

%>
</body>
</html>


What is the difference between declaring VBScript in <% here %> and <SCRIPT LANGUAGE="VBSCRIPT> here </SCRIPT> ??


Hope that answers a few more questions, if not u can email me at jack_ed_ripper@hotmail.com
I can't tell but I get differing degrees of success when I code with either of them. [/SIZE][/QUOTE]
Reply With Quote
Reply

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