views:

779

answers:

3

It seems that the following piece of HTML is ignored in IE7 but works ok in IE6/FF. It supposes to override all the html links to be opened in the desired frame

<HEAD>   
 <title>LeftPane</title>   
 <base target="rightFrame">  
</HEAD>

The above code is the header of a left frame that holds an Infragistics UltraWebTree (tree menu) which doesn't support the TargetFrame property.

Is there another way to add the target attribute to all the links elements on the desired page.

Any server or client-side code workarounds?

The site is built on ASP.Net 1.1 and Infragistics V 2.0

Update the web page is aspx an the doctype is

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+1  A: 

The href="" attibute is mandatory on the base tag - that's one possible explanation. You don't say what doctype you're using, but target is not allowed in strict XHTML.

Edit: tested it without href and it worked ok... that leaves the doctype, or something else.

Greg
A: 

Honestly, I know this isn't what you're asking but PLEASE don't use frames. They're already on their way out of the HTML/XHTML DTD's, are butt ugly and cause all kinds of issues browser-to-browser.

If you're looking for an easy to manage template system then I'd suggest just use simple PHP includes which may sound intimidating, but is actually extremely simple. Chances are if you have a cheap webserver PHP is already installed.

Andrew G. Johnson
i am supporting an application that is alredy builded, and the reason they use frames is because they load different applications on the right frame.the solution is .Net based and not PHP
Oscar Cabrero
You can do simple templating in .NET also. MasterPages are the out of box solution they provide for you.
Andrew G. Johnson
A: 

i dont know what was the issue because i test the base target in pure HTML and it works, wondering if ASP.net has to do something with it. but here is a piece of javascript code that add the target attribute to all link elements that doesnt have one

<script language="javascript">

    var tags=document.getElementsByTagName("a");
    for (i=0;i<tags.length;i++)
     { 
         if(!tags[i].getAttribute('target'))
             {
              tags[i].setAttribute('target',"right")
     }
     }


    </script>
Oscar Cabrero