Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery Open All Links in New Window | jQuery Open Hyperlinks in New Window

Aug 23, 2012
Introduction

Here I will explain how to use jQuery to open all links in New Window or jQuery make all links open in new window or jquery open hyperlink in new window.

Description:
  
In previous article I explained
expand textbox on focus and disable right click on image using JQuery and many articles relating to JQuery. Now I will explain how to open all hyperlinks in new window using JQuery in asp.net.

To implement this concept we need to write code as shown below


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JQuery open all hyperlinks in new window</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('a').click(function() {
window.open($(this).prop('href'), '', 'height=600,width=700');
return false;
});
});
</script>
</head>
<body>
<div>
<a href="http://www.aspdotnet-suresh.com/search/label/Asp.net">Aspdotnet-Suresh</a><br />
<a href="http://www.google.com">Google</a><br />
<a href="http://www.bing.com">Bing</a><br />
</div>
</body>
</html>
If you observe above code in header section I written code to open new window whenever click on new link on webpage.

Demo

If you want to check demo click on below links



If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

2 comments :

SHANKAR said...

Hello Suresh, article is very nice,but i have doubhts on VSTO .will you please forward your mail id.my mail id is shankar.parsanamoni@gmail.com

Anonymous said...

hello suresh i regularly watch ur posting they are good and easy to understand can u give best site to learnbasics of jquery

Give your Valuable Comments

Other Related Posts

© 2010-2012 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.