Forum Moderators: open
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%><%
PageName = Request.ServerVariables("SCRIPT_NAME")
Response.Write(PageName)
Response.Write("<br>")
Output = PageName.Substring(1,3);
Response.Write(Output)
%>
The message I'm getting is: Object doesn't support this property or method
I've tried lots of variations and posted the most simple, it's almost like the server doesn't know what a string is. Do I need to define it somewhere?
Thanks for looking.
The MID function does work fine for me in VBScript. The Problem I'm running into is the code snippet will be included in JScript pages.
I may end up trying to convert my entire site to VB or C# but was hoping to avoid it.
My ideal objective would be to find something that works like strchr in C. The idea is to get the URL and figure out what directory the script is being ran from so I can have a dynamic link menu.
Example:
mysite.com/widget/pagex would return links that relate to widgets
mysite.com/foo/pagex would return links that relate to foo