idodiane
10-11-2008, 09:07 PM
Can anyone help me resolve this javascript and vbscript problem? I have a jaaa.js and ASP page with the following VBScript code:
================================
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>AAAAAAAA</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="jaaa.js"></script>
</head>
<body>
<center>
<td valign="top" <p align="center"><img src="../clients/includes/AAA.gif" width="389" height="83" /></p>
<br><br>
<!-- #include file="includes/open.inc" -->
<table border=1 cellspacing=2>
<tr><th align=left>AAANNN</th><th>Published</th><th></th></tr>
<%
Const MenuSTR
Dim sql1
sql1 = "SELECT aaan.newsletter_id, aaan.newsletter_title, aaan.newsletter_fileName, aaan.newsletter_publish_date FROM aaan "
sql1 = sql1 & "WHERE aaan.newsletter_publish_date>=#" & session("sSinceDate") & "#;"
if request.querystring("admin")= "sql1" then
response.write sql1 & "<br><br>"
end if
ors.open sql1,oConn
if not ors.eof then
ors.movefirst
folderSTR = "aaafs"
MenuSTR = "#"
do until ors.eof
response.write "<tr>"
response.write "<td align=left><font size=2>" & ors("aaan_title") & "</font></td>"
response.write "<td><font size=2>" & formatDateTime(ors("aaan_publish_date"),2) & "</font></td>"
response.write "<td><a href=""" & folderSTR & "/" & ors("aaan_fileName") & MenuSTR & """ class="external" rel="external"><font size=2>View (aafs)</font></td>"
response.write "</tr>"
ors.movenext
loop
else
response.write "<tr><td colspan=3><i>No aaan found</i></td></tr>"
end if
%>
</table>
<br>
| <a href="loginCheck.asp"><font size=2>Admin Center</font></a> |
</body>
</html>
===================================================
The code in the jaaa.js file works perfect when I test it by using simple html page. But when I use this preceeding code to call the jaaa.js as in the <head></head> above the JAVAScript does not execute. The script if executed should find the "class="external" " as in the response.write "<td><a href=""" & folderSTR & "/" & ors("aaan_fileName") & MenuSTR & """ class="external" rel="external"><font size=2>View (aafs)</font></td>" line above such that when you click the View (aafs) link the javascript will do its job.
My problem is that when I click View (aafs) link the VBScript will run and do all it's design to do but the JAVAScript does not get executed and thereby no effect.
Can any of oyu out there offer me a good suggestion on how to make this work? or can you correct the code?
Thanks
================================
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>AAAAAAAA</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="jaaa.js"></script>
</head>
<body>
<center>
<td valign="top" <p align="center"><img src="../clients/includes/AAA.gif" width="389" height="83" /></p>
<br><br>
<!-- #include file="includes/open.inc" -->
<table border=1 cellspacing=2>
<tr><th align=left>AAANNN</th><th>Published</th><th></th></tr>
<%
Const MenuSTR
Dim sql1
sql1 = "SELECT aaan.newsletter_id, aaan.newsletter_title, aaan.newsletter_fileName, aaan.newsletter_publish_date FROM aaan "
sql1 = sql1 & "WHERE aaan.newsletter_publish_date>=#" & session("sSinceDate") & "#;"
if request.querystring("admin")= "sql1" then
response.write sql1 & "<br><br>"
end if
ors.open sql1,oConn
if not ors.eof then
ors.movefirst
folderSTR = "aaafs"
MenuSTR = "#"
do until ors.eof
response.write "<tr>"
response.write "<td align=left><font size=2>" & ors("aaan_title") & "</font></td>"
response.write "<td><font size=2>" & formatDateTime(ors("aaan_publish_date"),2) & "</font></td>"
response.write "<td><a href=""" & folderSTR & "/" & ors("aaan_fileName") & MenuSTR & """ class="external" rel="external"><font size=2>View (aafs)</font></td>"
response.write "</tr>"
ors.movenext
loop
else
response.write "<tr><td colspan=3><i>No aaan found</i></td></tr>"
end if
%>
</table>
<br>
| <a href="loginCheck.asp"><font size=2>Admin Center</font></a> |
</body>
</html>
===================================================
The code in the jaaa.js file works perfect when I test it by using simple html page. But when I use this preceeding code to call the jaaa.js as in the <head></head> above the JAVAScript does not execute. The script if executed should find the "class="external" " as in the response.write "<td><a href=""" & folderSTR & "/" & ors("aaan_fileName") & MenuSTR & """ class="external" rel="external"><font size=2>View (aafs)</font></td>" line above such that when you click the View (aafs) link the javascript will do its job.
My problem is that when I click View (aafs) link the VBScript will run and do all it's design to do but the JAVAScript does not get executed and thereby no effect.
Can any of oyu out there offer me a good suggestion on how to make this work? or can you correct the code?
Thanks