faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 5 people (0%) answered Yes
Recently 0 of 5 people (0%) answered Yes


how do I check whether the client can accept javascipt through ASP

Apr 5th, 2008 20:37
ha mo, Colin Fraser, sa sa,

To begin, all browsers accept javascript, so there is no issue there,
the problems you seem to be alluding to are 1) using javascript to write
ASP or 2)how can you write javascript in ASP code. ASP is, for me,
something of a nonsense, I tried to get it working and had limited
success. I found it cumbersome and slow, so I looked elsewhere and found
PHP, which produces faster and cleaner code. 
(This is for my purposes, I also found it cheaper in overhead,
considerably easier to reuse code, locate pre-written code snippets that
are easily adaptable, and most importantly, it was actually very cheap
in terms of money. My boss actually smiled upon me when I described this
part of it, I think it hurt his face btw..:). )
Anyway, you might want to try something like this:
<%@ language="javascript"%>
This line sets the scripting language you can use to javascript, but
beware, there is an issue here, javascript is case-sensitive in the ASP
environment. This means you need to write code like: 
Response.Write("<h1>ASP is nonsense </h1>")
To write javascript in ASP is like this : 
response.write("if (browser.appname=='Microsoft Internet
Explorer'){document.write('You are using MSIE, from the Dark Side') }
else {document.write('You are not using a product from the Dark Side') } )
ASP will only display in a page the instruction set you tell it to. 
Hope that answers your question.