...

View Full Version : How do I convert vbscript to jscript?



dirwin26
12-06-2006, 08:18 PM
Hi all, my request I think is quite simple. All I want to do is open a new window from my webpage in a resized window. Sorry for the clutter. Any help is appreciated. Thanks.

My button code(jscript) looks like this:
<FORM>
<INPUT type="button" value="target" onClick="window.open('http://ipaddress/js','mywindow','width=400,height=200')">
</FORM>

the destination page(vbscript) looks like this:

<%@ LANGUAGE="vbSCRIPT"%>

<%
Ticker = request.form("Ticker")
Multiple = request.form("multiple")
quarter = request.form("quarter")

Set odbc = Server.CreateObject("ADODB.Connection")
odbc.Open "DRIVER={SQL Server};SERVER=IPadress;Database=ddx;UID=sa;PWD=ddx;APP=web;"

SQL = "EXEC ddx..as00 @Ticker='" & ticker & "',@multiple='"&multiple&"',@quarter='"&quarter&"'"

Set RS = Server.CreateObject("ADODB.RecordSet")
RS.Open SQL, odbc, 0, 1

Do While not RS.EOF
price = RS("price")
RS.Movenext
Loop

set rs=RS.NextRecordset()
Do While not RS.EOF
target =RS("target")
RS.Movenext

Loop


RS.Close
%>

Current Price
$<%=price%>
<TD><BR>
Target Price
$<%=target%>
<BR>
Return
<%=(formatpercent((target-price)/price))%>

liorean
12-07-2006, 12:35 AM
The button code is client side JavaScript, the popup code is ASP using VBScript and server side. Are you asking to convert the server side (ASP using VBScript) into ASP using JScript, or are you asking to turn the server side code into client side code?

The database is server side. The only way to access a database is through server side code, so it's impossible to turn this code into client side JavaScript. The only communication between server and client is in the form of pure textual requests and responses. Which leads to the conclusion: What server side language is used for generating the pure textual responses hardly matters to the client since it's all the same pure textual data anyway.

dirwin26
12-07-2006, 05:45 PM
The only code I need direction on is the button code, jscript, so that I can resize the new window. My understanding is that to perform a pop-up resized window, all i need is client side jscript. I do not want to 'convert' any of the server side code. From what I have read, it is a matter of adding <script language="JavaScript"></script>, which I have done, but the data from the server is not showing up, it actually says page does not exist.

Does that make sense?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum