Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scripting issue

Status
Not open for further replies.

sds814

Programmer
Feb 18, 2008
164
US
Pretty new to classic ASP so I apologize if I use the wrong technical words..

Here is the code I have:
Code:
function getHelpUrl(strHelpURL)
{
    getHelpUrl = GetDictValue(Application("dictHelpPages"), strHelpURL);
    return (getHelpUrl);
}
some code...
Code:
<% dim strURL: strURL = Request.ServerVariables("PATH_INFO")
dim iLength: iLength = instr(2, strURL, "/")
dim strHelpURL: strHelpURL = mid(strURL, iLength + 1, (len(strURL) - 4)) 
dim strTestURL : strTestURL = GetDictValue(Application("dictHelpPages"), strHelpURL)
%> 
<a href="/logoff.asp">Logout</a> | <a target="_blank" href='javascript:getHelpUrl(strTestURL)'>Help</a>

The issue that I'm having is that strTestURL is undefined as it's between the <% %> section. So how do I include the <a> tag in the <% %> so strTestURL is interpreted?

Thanks.
 
Try:
Code:
a target="_blank" href='javascript:getHelpUrl("<%=strTestURL%>")>Help</a>

Lee
 
Get the error "Object expected" in getHelpUrl = GetDictValue(Application("dictHelpPages"), strHelpURL); line of the function getHelpUrl
 
Yes, have a function called GetDictValue.
Here is the solution:
Code:
<% dim strURL: strURL = Request.ServerVariables("PATH_INFO")
dim iLength: iLength = instr(2, strURL, "/")
dim strHelpURL: strHelpURL = mid(strURL, iLength + 1) 
strHelpURL = GetDictValue(Application("dictHelpPages"), strHelpURL) 
%>
<a href="/logoff.asp">Logout</a> | <a target="_blank" href=<%=strHelpURL%>>Help</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top