Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-06-2006, 07:18 PM   PM User | #1
dirwin26
New to the CF scene

 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dirwin26 is an unknown quantity at this point
How do I convert vbscript to jscript?

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))%>
dirwin26 is offline   Reply With Quote
Old 12-06-2006, 11:35 PM   PM User | #2
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
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.
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 12-07-2006, 04:45 PM   PM User | #3
dirwin26
New to the CF scene

 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dirwin26 is an unknown quantity at this point
jscript pop-up window

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?
dirwin26 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 10:27 PM.


Advertisement
Log in to turn off these ads.