This is a discussion on "[SOLVED] Link to another page in JavaScript" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Link to another page in JavaScript are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Link to another page in JavaScript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Link to another page in JavaScript
How do you put a link within JAVA
I am after linking .../page1/index.html to page1 below and similar to page2
Dan |
|
|
|
||||
|
Re: Link to another page in JAVA
JAVA or JavaScript?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Link to another page in JAVA
javascript, can supply all script if req
|
|
||||
|
Re: Link to another page in JavaScript
Changed title so it says "JavaScript" instead of "JAVA".
|
|
||||
|
Re: Link to another page in JavaScript
Not really sure how you want to link the pages.
Post your script and explain a little clearer for a better answer.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Link to another page in JavaScript
var current="Update is now required" (when Update is now required is shown it is a link to a another page) the above text to be links "update required" one link then when time runs out the "update is now required" required another link. Does that make a little more sence Last edited by R8515198; Jan 29th, 2008 at 07:24. |
|
||||
|
Re: Link to another page in JavaScript
When you want to change the current page with javascript you just change the windows loacation..
window.location.href = 'page.html'; Will work just as well. In you script if you need to change the page based on some even you just set the variables before and current to the URL's you want and change the page like
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Link to another page in JavaScript
Cant get it to work.
var before="Update required" var current="Update is now required" If we say the URLs are: (before)yahoo.com and (current)google.com |
|
||||
|
Re: Link to another page in JavaScript
If you're linking to another domain you need to include the whole URL.. eg protocol/server/path/query
var before = 'http://www.yahoo.com'; var current = 'http://www.google.com';
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Link to another page in JavaScript
When I do the above it just shows the URL and it is not a link?
|
|
||||
|
Re: Link to another page in JavaScript
Oh!.. You don't want to send the page to a different URL, you actuall want to write an <a></a> link to the page... I misunderstood.You would just need to change var before = '<a href="http://www.yahoo.com">Yahoo.com</a>'; var current = '<a href="http://www.google.com">Google.com</a>';
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Link to another page in JavaScript
You are a genius,
That has just completed a very big part of my project, when looking at it - it was simple but when you stare at hte code for so long ur mind goes blank. I appriciate the help RAKULI, I owe you a beer. ![]() |
|
|||
|
Re: [SOLVED] Link to another page in JavaScript
That doesn't look like the quality beer Rakuli would be after!
lol Ed.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Making a link non-link when on the page. | mcdanielnc89 | Web Page Design | 1 | Nov 16th, 2007 08:05 |
| [Tutorial -> Trick] Link checking using JavaScript (ny myself) | RohanShenoy | JavaScript Forum | 7 | Nov 8th, 2007 12:52 |
| [SOLVED] Javascript Printer-Friendly Page "Creator" | Stuart | JavaScript Forum | 33 | Oct 13th, 2007 13:06 |
| how to link a php page to the designed page | s_mazhar | PHP Forum | 3 | Dec 28th, 2005 05:21 |
| Can you link in .asp files like you can .css and Javascript? | Andy K | Classic ASP | 2 | Jul 13th, 2005 10:13 |