[thelist] Javascript - Permission Denied
Rob Smith
rob.smith at THERMON.com
Mon Mar 7 11:39:07 CST 2005
>> onLoad="toggleSub('zzz" & auto(0) & "')
> Try the +
I do apologize, the complete body tag is:
<body <% if not request.QueryString("productauto") = "" then response.write
"onLoad=""toggleSub('zzz" & auto(0) & "')"""%>>
> try quotes:
> document.getElementById("submenu")
Via function toggleSub(submenu) {
submenu is a parameter. Adding double quotes threw another error that it
wants the object called "submenu".
> Do you have a link we can see,
No. but I can offer the simplified source code.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/web_request.asp" -->
<%
response.Buffer = false
Response.Expires = -5000
session.Codepage=1251
SQL = ""
if not request.QueryString("productauto") = "" then
auto = split(request.QueryString("productauto"),"#")
SQL = " and productauto=" & auto(0)
end if
Letter = ""
if not request.QueryString("letter") = "" then
Letter = " and productid like '" & request.QueryString("letter") & "%' "
end if
set Products = Server.CreateObject("ADODB.Recordset")
Products.ActiveConnection = MM_web_request_STRING
Products.Source = "SELECT ProductID, ProductAuto FROM Product WHERE status
= 'active' " & SQL & " " & Letter & " order by ProductID"
Products.CursorType = 0
Products.CursorLocation = 2
Products.LockType = 3
Products.Open()
set ProductMedia = Server.CreateObject("ADODB.Recordset")
ProductMedia.ActiveConnection = MM_web_request_STRING
ProductMedia.CursorType = 0
ProductMedia.CursorLocation = 2
ProductMedia.LockType = 3
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Link Manager</title>
<meta http-equiv="content-type" content="text/html;
charset=windows-1251">
<link href="../css/linkmanager.css" rel="stylesheet"
type="text/css">
<META HTTP-Equiv="Cache-Control" Content="no-cache">
<META HTTP-Equiv="Pragma" Content="no-cache">
<script language="javascript">
function toggleSub(submenu) {
//alert(submenu);
if (document.getElementById(submenu).style.display == 'none') {
document.getElementById(submenu).style.display = 'block'
} else {
document.getElementById(submenu).style.display = 'none'
}
}
</script>
</head>
<body <% if not request.QueryString("productauto") = "" then response.write
"onLoad=""toggleSub('zzz" & auto(0) & "')"""%>>
<%
Dim DateToday
DateToday = Date
%>
<div class="container">
<!-- #include file = "logo1920.inc" -->
<div align="center">
<br />
</div>
<!-- Left Column -->
<div class="left">
<div class="sidestuff">
<!-- #include virtual = "/inc/adminnav.inc" -->
</div>
</div>
<!-- Main Column -->
<div class="centerc">
<h3><u>Link Manager</u></h3>
<a href="LinkManager.asp">All</a> | <a
href="LinkManager.asp?letter=A">A</a> | <a
href="LinkManager.asp?letter=B">B</a> | <a
href="LinkManager.asp?letter=C">C</a> ... goes through to Z
<table cellpadding="0" cellspacing="3">
<% while not Products.eof %>
<tr>
<td class="header">
<a name="a<%=Products.fields.item("ProductAuto").value%>"></a>
<a
href="?productauto=<%=Products.fields.item("ProductAuto").value%>#a<%=Produc
ts.fields.item("ProductAuto").value%>"
onClick="toggleSub('<%=Products.fields.item("ProductAuto").value%>')"><%=Pro
ducts.fields.item("ProductID").value%></a> - <a
href="AddLink.asp?productauto=<%=Products.fields.item("ProductAuto").value%>
">Add a Link</a>
</td>
</tr>
<tr id="zzz<%=Products.fields.item("ProductAuto").value%>"
style="display:none;">
<td class="products">
<table width="100%">
<%
ProductMedia.Source = "SELECT ProductMedia_ID, EnglishLink,
EnglishTitle, category FROM [PDF Catalog] WHERE ProductAuto = " &
Products.fields.item("ProductAuto").value & " and category = 'Product'
order by productmedia_id"
ProductMedia.Open()
if not ProductMedia.eof then
response.write "<tr><td colspan=3><b>Product
Literature</b></td></tr>"
while not ProductMedia.eof
%>
<tr><td width="50"> </td><td>• <a
href="<%=ProductMedia.fields.item("EnglishLink").value%>"
target="_blank"><%=ProductMedia.fields.item("EnglishTitle").value%></a></td>
<td align="right"><a
href="moveup.asp?productmediaid=<%=ProductMedia.fields.item("ProductMedia_ID
").value%>&productauto=<%=Products.fields.item("ProductAuto").value%>&catego
ry=<%=ProductMedia.fields.item("category").value%>"><img src="grfx/up.gif"
width="10" height="10" border="0" alt="Move Link Up"></a> <a
href="editlink.asp?productmediaid=<%=ProductMedia.fields.item("ProductMedia_
ID").value%>&productauto=<%=Products.fields.item("ProductAuto").value%>&cate
gory=<%=ProductMedia.fields.item("category").value%>"><img
src="grfx/edit.gif" width="10" height="10" border="0" alt="Edit this
link"></a> <a
href="movedown.asp?productmediaid=<%=ProductMedia.fields.item("ProductMedia_
ID").value%>&productauto=<%=Products.fields.item("ProductAuto").value%>&cate
gory=<%=ProductMedia.fields.item("category").value%>"><img
src="grfx/down.gif" width="10" height="10" border="0" alt="Move Link
Down"></a></td></tr>
<%
ProductMedia.movenext
wend
end if
ProductMedia.close()
%>
</table>
</div>
</body>
</html>
The move up.asp code in question that may also be the culprit is:
<%
' do temp switching
response.redirect("LinkManager.asp?productauto=" &
request.QueryString("productauto") & "#a" &
request.QueryString("productauto"))
%>
More information about the thelist
mailing list