How to jump to new page in javascript.

J

Jim

Seems this should be simple but I can't find how to do it in any
of my JavaScript books.

I want to jump to a new page in a function, thusly,

function jumper( where )
{
if ( where == "here" )
{
'jump' "/myWebApp/here.jsp";
}
else if ( where == "there" )
{
'jump' "myWegApp/there.jsp";
{
else
{
'jump' "myWebApp/nowhere.jsp";
}
}

The best I've been able to do is reset the action attribute in a form
object and submit it:
function jumper( form, where )
{
form.action = where;
form.submit();
}
Seems like it should be easier. Any suggestions?

Thanks in advance.

jim cant
 
C

Chris Smith

Jim said:
Seems this should be simple but I can't find how to do it in any
of my JavaScript books.

Since it's a JavaScript question, it's really not appropriate for
comp.lang.java.programmer. I'm adding comp.lang.javascript to the
distribution, and setting followups to exclude cljp.
I want to jump to a new page in a function, thusly,

The best I've been able to do is reset the action attribute in a form
object and submit it:
function jumper( form, where )
{
form.action = where;
form.submit();
}
Seems like it should be easier. Any suggestions?

window.location.href = 'newpage.html';

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top