•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,749 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,763 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 12676 | Replies: 2
![]() |
•
•
Join Date: Jul 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Hi ,
I have a function as :
function doCheck(str1,str2)
{
top.LocalCacheLoadStatus = false;
parent.SearchFrame.location.href=str1;
g_str_Mode = str2;
alert (g_str_Mode);
}
This has str1 as the name of the jsp file and str2 is the value which i have to pass to the jsp file given in str1.How do i do that ?
Thanks & Regards
Soni
I have a function as :
function doCheck(str1,str2)
{
top.LocalCacheLoadStatus = false;
parent.SearchFrame.location.href=str1;
g_str_Mode = str2;
alert (g_str_Mode);
}
This has str1 as the name of the jsp file and str2 is the value which i have to pass to the jsp file given in str1.How do i do that ?
Thanks & Regards
Soni
•
•
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation:
Rep Power: 4
Solved Threads: 4
Try this:
If you need to pass the variable to the jsp page, and you don't need your user to ever see the output from that jsp page--that is, you want the user to stay on the current page without noticing the value was submitted, you can use a hidden iframe--and navigate it instead of your main page. You can also use an AJAX solution, but an iframe does just fine and is easier to make compatible across browsers.
function doCheck(str1,str2) {
top.LocalCacheLoadStatus = false;
parent.SearchFrame.location.href=str1;
g_str_Mode = str2;
alert (g_str_Mode);
var url = str1+".jsp?str2="+str2;
alert(url);
document.location = url;
}If you need to pass the variable to the jsp page, and you don't need your user to ever see the output from that jsp page--that is, you want the user to stay on the current page without noticing the value was submitted, you can use a hidden iframe--and navigate it instead of your main page. You can also use an AJAX solution, but an iframe does just fine and is easier to make compatible across browsers.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- javascript to jsp (JSP)
- Passing variable value from javascript to jsp page at run time (JSP)
- javascript variable in jsp session (JSP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Dropdown menu
- Next Thread: Javascript generated drop down menu


Linear Mode