• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to open new jsp page in current tab by click on menu?

 
Sumit Sonone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<td class="bottomlinks"><a href="home.jsp">Homepage</a></td>

This is my menuitem. When i click on menu then it opens a new jsp page in the new tab and current tab still remains. I want to close current page and open new page in current tab. Please someone help me...
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's controlled two ways. By the "target" attribute of the href element, and by the browser settings. Since you aren't using the target attribute, the link should open in the same window. If it isn't, that means the browser is configured to open links in a new tab and you have no control over that unless you use Javascript in your links instead of standard html. If you want to try that tactic, search on "location.href" for tips.

 
Sumit Sonone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should i write in the <script> tag and where it should be placed.
 
Sumit Sonone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the answer. It should be like <td class="toplinks"><a href="home.jsp">Homepage</a></td>
The target attribute should not be included.
Thanks for response...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic