Base tag, IE and JavaScript

If you use the <base> tag, links in JavaScript (window.open for example) will ignore the <base> tag. The way around it is to make the link in the JavaScript relative to the domain.

<base href=”http://www.example.com/this_site/”&gt;

The JavaScript should look like this.

window.open(‘/this_site/page2.html’);

Advertisements

There are no comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: