473,655 Members | 3,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send a browser to a link with Javascript

How do you send a browser to a link when a command is given? I've
tried using Java Server Pages <jsp:forward /command but that doesn't
change the link in the address bar and some other problems arise with
it. A javascript method would work in what I'm doing but I don't know
what that command would be. Basically, when a button is pressed I want
some session data to be set and for a link to be followed.

Any ideas?

Jul 22 '06 #1
2 1960
Well I found one way just now but I don't think it will work. What I
tried was the following successful command in a javascript function:

document.locati on.href="index. html";

I think what I'm really wanting is for a form to be submitted to a
particular page. Let me explain further. I have 3 basic forms that
represent 3 object types. Object 2 has an object 1 and object 3 has an
object 2. So if I'm on a form for object 2 and I want to create a new
object 3 I would want to go to the object 3 form with the correct
object 2 value selected based on the previous form. I guess I could do
this with sesssion data but I'm unclear on that as well. How do I set
session data?

I also want the forms cancel button to revert the user back to the
previous form they were on. Here I'm thinking I will keep a list of
forms that have been visited and push and pop pages off that list as
the user navigates the forms. I can imagine doing this with session
data or with hidden input variables that I set at the bottom of the
form.

mcrave...@wrigh t.edu wrote:
How do you send a browser to a link when a command is given? I've
tried using Java Server Pages <jsp:forward /command but that doesn't
change the link in the address bar and some other problems arise with
it. A javascript method would work in what I'm doing but I don't know
what that command would be. Basically, when a button is pressed I want
some session data to be set and for a link to be followed.

Any ideas?
Jul 22 '06 #2
What do you mean "command"?

I manage a wizard setup by creating a form with an empty action, and a
js function to set the action. The "previous" button sets the form
action to the previous page, the "next" button sets the form action to
the next action, "finish" to the last page, etc.

Jason

mc*******@wrigh t.edu wrote:
Well I found one way just now but I don't think it will work. What I
tried was the following successful command in a javascript function:

document.locati on.href="index. html";

I think what I'm really wanting is for a form to be submitted to a
particular page. Let me explain further. I have 3 basic forms that
represent 3 object types. Object 2 has an object 1 and object 3 has an
object 2. So if I'm on a form for object 2 and I want to create a new
object 3 I would want to go to the object 3 form with the correct
object 2 value selected based on the previous form. I guess I could do
this with sesssion data but I'm unclear on that as well. How do I set
session data?

I also want the forms cancel button to revert the user back to the
previous form they were on. Here I'm thinking I will keep a list of
forms that have been visited and push and pop pages off that list as
the user navigates the forms. I can imagine doing this with session
data or with hidden input variables that I set at the bottom of the
form.

mcrave...@wrigh t.edu wrote:
How do you send a browser to a link when a command is given? I've
tried using Java Server Pages <jsp:forward /command but that doesn't
change the link in the address bar and some other problems arise with
it. A javascript method would work in what I'm doing but I don't know
what that command would be. Basically, when a button is pressed I want
some session data to be set and for a link to be followed.

Any ideas?
Jul 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2669
by: edykstra | last post by:
Hello, If you point your browser to this page, http://prdownloads.sourceforge.net/vnc-tight/tightvnc-1.2.9_x86_viewer.zip?use_mirror=umn the server sends you the HTML page, and very soon afterwards, you are prompted to do a 'Save-As' for a file to download. How do they do that without the classic "Headers already sent" error?
6
3532
by: bayram guzer | last post by:
hi everybody, i have very strange error. i can not see some of the asp pages on my browser. when i look from view source, all the source is there but browser does not show anything, just an empty page. Does anybody have idea about this ?
3
3346
by: Erik T. Nomad | last post by:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm wondering if there's a way to customize it further, such that the hyperlink they are sent is the web address of the page the "send to friend" link was on. I don't want to convert my entire site over to .asp, so having a pop-up .asp page seems to make...
13
2073
by: AMC | last post by:
Hi, I have the below code in an asp page. When I run this page in IE or Opera it correctly displays the header info and does not redirect me to 'test.html'. However, when I run this in Netscape it goes straight to the redirect page 'test.html' which indicates that javascript is not enabled and it also does not display the header info. Can someone tell me why this is happening? <%@ Language=VBScript%> <%'get header info
5
1767
by: Prabhat Nath | last post by:
Hi All, Is that possible that I can send request to IIS Server after a .ASP page is displayed? My Requirement is: Clinet will Fill the Details in one Request Form after the details are filled then the Request Files will be shown to the user as Link in Another page. (Currently before Sending the Link Page to Customer I am updating DB
6
11175
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
4
2286
by: Thomas Eichner | last post by:
Hi, does anybody know a public website which offers a service that displays all data send by a browser (or an app calling the website), especially HTTP GET and POST data, browser data etc.? I have a hard time finding what really my app is sending and this would be a great help! Thank you very much ! Thomas
1
1871
by: Anil G | last post by:
Hi! If page has the link, let say page has following hyperlink <a href="javascript:editUser('<c:out value="${users.id}"/>')"><c:out value="${users.username}"/></a> Now, on web browser, bottom section at runtime, following will be displayed: javascript:editUser('457592-11783');
9
77425
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.