How can I open a link without opening it in a frame.

I have my main frame being Frame1 My menu Frame is Frame2 <a href="mysite.com" target=???????>

I want it to open it in the same window, but destroy all frames because it is the link to home so it will automatically recreate these frames.

For now I am using top.location=...

try target="_top"

Leave OUT the target property altogether. It is deprecated.

Why not just let it open a new tab?

MidiMagic; again, please; do not jump to the assumption that the person posting is using a strict document type - the target property does not exist in the strict document type definitions for XHTML 1.0 and HTML 4.0.

It has not been deprecated; and is a part of the XHTML and HTML transitional doctypes; and the XHTML and HTML frameset documents - infact, the frameset DTDs exist in order to provide support for this property into the future.

Notice; the html version number in this link, which explains frames / targets in alot of detail:

http://www.w3.org/TR/html401/types.html#type-frame-target

commented: bingo! +6

It is not a matter of jumping to a conclusion, but having an eye to the future.

Within a few years, browsers will no longer support deprecated elements. Every book I have on the subject warns that this will eventually happen. The transitional doctypes are said to be temporary. Anyone who uses deprecated elements will suddenly find himself with a lot of work to do to fix every page he has. One book says (in the instructions of a table of HTML elements):

"An X indicates that the tag is deprecated (strongly discouraged) in html 4, and will likely be rendered obsolete in future browsers. You may need to use some of these deprecated tags to meet the needs of your audience now, but if your audience will be using very new browsers that support style sheets and HTML 4 completely, we strongly suggest that you avoid deprecated elements."

Target=name is listed as being deprecated in every book on HTML I have except one. That book was printed in 2000. One book has:

"Caution: The target attribute has been deprecated.

However, I just noticed that that it might be that what has really been deprecated is "name", as used for anchor links. It has been replaced by "id", because name has other incompatible uses in other HTML tags.

Another source: "However, frames have turned out to be more of a fad. You can have many of the benefits realized by using frames by using the infinitely more flexible and powerful CSS formatting methods."

commented: FUD -1

Mm, maybe so with regard to planning for the future; but the original poster is clearly using frames at the moment; which are likely to be supported in major browsers for at least a few more years.

XHTML and HTML strict do not have the target attribute; it wasn't deprecated, but it is not a part of those standards. There is a big difference.

Not all web development involves producing latest standards-perfect HTML creations. If I am demonstrating some purely functional server side code for example; and I know a web designer is going to be making a fancy standards compliant frontend for it; there's no reasonable reason why I shouldn't use frames and targets temporarily.

Many professional sites still use frames, and even archaic document types. Offline HTML help for big products often uses frames; they work offline without giving security warnings, and pertain to a handy split between an 'index' and a one-page display.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.