Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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))%>

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    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

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •