tags:

views:

99

answers:

9

I hava a web application. In that i have a link called "Home". When the user clicks the starting page of the web application that is index.jsp should be displayed in the same page. How can i do that. It should work in internet explorer.

I have the following html page.

<html>

<body bgcolor="#FFF8DC">

<a href="index.jsp" target="parent" >HOME</a>


</body>
</html>

But it is not working.

+4  A: 

< a href="url">home< /a >

Warrior
A: 

The command does not work. The index page is displayed in the Home link itself.

<html>

<body bgcolor="#FFF8DC">

<a href="index.jsp" target="_blank" >HOME</a>


</body>
</html>

I worked with the above code. it works very well in Internet explorer but not in mozilla. I want it to work in mozilla also.

Thanks

YOu need to format your HTML using the "code sample" button, otherwise it just gets stripped out.
Paul Dixon
A: 

Perhaps you intended TARGET="_parent" ? This allows a link to load in a parent frame

Paul Dixon
+1  A: 

Probably is a problem addressing the jsp page. Try using the complete URL.

Ubersoldat
A: 

target="_parent"

note the _ in _parent

DrG
+4  A: 

In order for your link to open in the same window it resides in, use:

<a href="foo.html" target="_self">some text</a>

Please note the underscore before self. If you do not use it, your browser will look for a frame named "self".

Aron Rotteveel
The requirement is similar to refresh button on the browser. When i click home i need the starting page of the application should be opened in the same window
I do not quite get what you mean; do you want to create a link that points people to their browser's homepage?
Aron Rotteveel
+4  A: 

See http://htmlhelp.com/reference/html40/special/a.html

The TARGET attribute is used with frames to specify the frame in which the link should be rendered. If no frame with such a name exists, the link is rendered in a new window unless overridden by the user. Special frame names begin with an underscore:

* _blank renders the link in a new, unnamed window
* _self renders the link in the current frame (useful for overriding a BASE TARGET)
* _parent renders the link in the immediate FRAMESET parent
* _top renders the link in the full, unframed window

In HTML 4, the TARGET attribute value is case-insensitive, so that _top and _TOP both have the same meaning. However, most browsers treat the TARGET attribute value as case-sensitive and do not recognize _TOP as having the special meaning of _top.

Goran
thanks. it is working. but will it work in IE also. I have checked in mozilla
Yes - it is a part of language specification.
Goran
+1  A: 

You're just missing an underscore. "self" is treated as any other name label.

annakata
A: 

Alternatively, you can just skip the target attribute of the link. Target defaults to the same browser window if you don't specify otherwise.

fred-o