shaffiq_fiq88 Posted August 6, 2010 Share Posted August 6, 2010 Hello.I'm looking for a method to integrate the variables of ASP into Javascript. Is it possible? If possible, how can it be? I'm OK with ASP Scripting but nothing in Javascript Scripting.As an example : <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><%Option Explicit%><!--#include virtual="/server/config/connection.asp" --><%Dim Conn, LoadServerVar, SVArrowConn = GlobalConnSet LoadServerVar = Server.CreateObject("ADODB.Recordset")LoadServerVar.Open "Select * From ServerVar Where ServerVarID = 1",Conn,3,3SVArrow = LoadServerVar("ServerVarArrow")%><script language="javascript">var JVSVArrowJVSVArrow = <!-- Some code here containing ASP Variable SVArrow --></script><p> ASP VBScript Method : <%=SVArrow%></p> <!-- Output will be /server/img/arrow.gif --><p> Javascript Method : <!-- Some code here containing Javascript Variable JVSVArrow and the output will be /server/img/arrow.gif, same as ASP VBScript output method --> </p> So, can anyone help me to integrate the SVArrow ASP Variable into a Javascript scripting? Please.Thanks Link to comment Share on other sites More sharing options...
boen_robot Posted August 6, 2010 Share Posted August 6, 2010 ASP runs on the server, and JavaScript runs on the client. They do not interact with each other.You can use ASP to write out JavaScript (the same way you write out anything - write "plain text" that happens to be JavaScript in the "eyes" of the browser), but that JavaScript will not know that it was ASP that generated it, and will only execute after ASP has completed all of its work. Link to comment Share on other sites More sharing options...
shaffiq_fiq88 Posted August 6, 2010 Author Share Posted August 6, 2010 OK. I got it. Thanks so much. :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.