Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > BASE HREF tag

Reply
Thread Tools

BASE HREF tag

 
 
John Smith
Guest
Posts: n/a
 
      06-27-2003
Is there a way to get Javascript to obey the <BASE HREF=""> tag? I
have some code that redirects a user to a template on a different
domain, but it keeps taking me to the current domain.

Code sample:
<base href="http://www.example.com">

<SELECT onChange="location=this.options[this.selectedIndex].value;">
<OPTION VALUE="shwspool.html">View Spool Directory</OPTION>
<OPTION VALUE="monacc.html">View Monitor Access Log</OPTION>
<OPTION VALUE="monsys.html">View Monitor System Log</OPTION>
</select>

Any help would be greatly appreciated!



 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      06-27-2003
John said:
>
>Is there a way to get Javascript to obey the <BASE HREF=""> tag? I
>have some code that redirects a user to a template on a different
>domain, but it keeps taking me to the current domain.
>
>Code sample:
><base href="http://www.example.com">


Off the top of my head, that's not a valid base href value.
Try:

<base href="http://www.example.com/">

 
Reply With Quote
 
 
 
 
John Smith
Guest
Posts: n/a
 
      06-27-2003
On 26 Jun 2003 20:44:57 -0700, Lee <(E-Mail Removed)> wrote:

:John said:
:>
:>Is there a way to get Javascript to obey the <BASE HREF=""> tag? I
:>have some code that redirects a user to a template on a different
:>domain, but it keeps taking me to the current domain.
:>
:>Code sample:
:><base href="http://www.example.com">
:
:Off the top of my head, that's not a valid base href value.
:Try:
:
:<base href="http://www.example.com/">

It still didn't solve my original problem, however


 
Reply With Quote
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      06-27-2003
John Smith <(E-Mail Removed)> writes:

> Is there a way to get Javascript to obey the <BASE HREF=""> tag? I
> have some code that redirects a user to a template on a different
> domain, but it keeps taking me to the current domain.
>
> Code sample:
> <base href="http://www.example.com">
>
> <SELECT onChange="location=this.options[this.selectedIndex].value;">
> <OPTION VALUE="shwspool.html">View Spool Directory</OPTION>
> <OPTION VALUE="monacc.html">View Monitor Access Log</OPTION>
> <OPTION VALUE="monsys.html">View Monitor System Log</OPTION>
> </select>


Try something like:

function goto(url) {
location.href = document.getElementsByTagName('base')[0].href + url;
}
...
<select onchange="goto(this.options[this.selectedIndex].value)">

(warning:untested)
/L
--
Lasse Reichstein Nielsen - http://www.velocityreviews.com/forums/(E-Mail Removed)
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BASE HREF and A HREF="#" onclick="..." Vincent van Beveren Javascript 2 07-06-2006 08:33 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
autopostback and <base href...> tag Sam ASP .Net Web Controls 0 06-29-2004 03:58 AM
Programmatically change base href tag just1coder Javascript 1 05-15-2004 02:39 AM
Getting href attribute of <base> tag? Weston C Javascript 7 01-04-2004 12:53 AM



Advertisments