JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

     
Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > QueryString Method with a JavaScript Menu?  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: QueryString Method with a JavaScript Menu?
DukeDiablo is not online. Last active: 7/28/2004 3:52:08 PM DukeDiablo
www.filebox.vt.edu
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 2
 
QueryString Method with a JavaScript Menu?
Posted: 27 Feb 2002 07:46 AM
Dear Forum-

I am currently having a problem. I am using a drop down style JavaScript menu that can be viewed here:

http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=4222

My problem is that I am working on a system where I need to pass some variables using the VBScript QueryString method(I believe is the right terminology); however I cannot figure out how to accomplish that with this JavaScript menu. When I put in something like the following:

// text|URL|target of second sublink
"Existing|Customer_Check.asp?AgentName=" & AgentName & "|main;"

I get an error saying that "AgentName" is not defined, then I also get another object error or something..which I think is just a chain reaction error from the first. Is there a QueryString method in Java or some similar technique that would get the job done, an still work with my next ASP page which uses VBScript?

I don't know how to contact the author of this script, so I'm sorry to bother yall with my problem. Any help/information would be greatly appreciated.

Thank you very much and have a great week.

Sincerely,
Jim Kennedy
DukeDiablo@Aol.com

Sincerely,
Jim Kennedy
DukeDiablo@Aol.com
Admin is not online. Last active: 12/1/2005 12:27:12 PM Admin
Top 25 Poster
Forum Moderator
Joined: 28 Jul 2004
Total Posts: 15
 
Re:
Posted: 27 Feb 2002 10:37 AM
Hey,

I had to embed asp into js variables once and this is how i did it.

I dont know how to get ASP to recognize js variables however You can get JS to recognize ASP variables. for example

<script language="javascript">
function myFunc(){
tempURL = "Existing|Customer_Check.asp?AgentName"
URL = tempURL+<%=ASPVariable%>+"the rest of the url"
or
URL = tempURL+<%=request.querystring ("ID")%>+"the rest of the url"

document.location = URL

This is how I embed ASP into JS. Hope this helps somewhat.

If you would like I can give you my exact code I used for similar problem.



DukeDiablo is not online. Last active: 7/28/2004 3:52:08 PM DukeDiablo
www.filebox.vt.edu
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 2
 
Re:
Posted: 28 Feb 2002 11:25 PM
Thanks SkullBoyNot-

I appreciate the response and the information.

I did figure out how to accomplish what I was after using the following:

--I set up some VBScript variables and code similar to this...

Dim UserType

UserType = Request.QueryString("UserType")

--Then I changed my link section of the JavaScript like so...

// text|URL|target of second sublink
"Existing|Customer_Check.asp?AgentName=<% =AgentName %>
&JobType=<% =JobType %>
&EmpID=<% =EmpID %>|main;"

--By using the <% =variablename %> write method, I was able to insert the VBScript variable values into the existing QueryString dynamically.

Thanks again for your method as well, that may also come in handy!

Have a great weekend.

Sincerely,
Jim Kennedy
DukeDiablo@Aol.com

Edited by - DukeDiablo on 02/28/2002 23:26:49

Sincerely,
Jim Kennedy
DukeDiablo@Aol.com
Darren is not online. Last active: 7/28/2004 3:52:08 PM Darren
www.letsystem.org.uk
Joined: 28 Jul 2004
Total Posts: 2
 
Re:
Posted: 03 Mar 2002 02:17 PM


// text|URL|target of second sublink
"Existing|Customer_Check.asp?AgentName=" & AgentName & "|main;"

I get an error saying that "AgentName" is not defined, then I also get another object error or something..

AgentName is not defined as you need to replace the variable server-side. The Javascript viewed as source should show the variable you require, client-side. If AgentName is caught using asp, then you could replace the javascript along the lines as follows...

"Existing|Customer_Check.asp?AgentName=" + <%=AgentName%> + "|main;"



darren mills

darren mills
Previous Thread :: Next Thread 
Page 1 of 1
 
Jsmadeeasy.com  > JS Made Easy  > JavaScript programming  > QueryString Method with a JavaScript Menu?