Jump to content

Integrate ASP and Javascript


shaffiq_fiq88

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...