Open non-aspx links in a new window

June 07, 2010

Navigation Menu Links

If you want non-aspx menu links opens in a new window just add the following condition into the <a> tag in your custom OWS menu configuration:

{IIF, "'[FORMAT,\"[NewURL]\",{CONTAINS:.aspx}]'='True'", "", "target=\"_blank\""}

Notice: How to create Navigation Menu is described here

Everything Links Everywhere

If you want that non-aspx links throughout the site (including links which in static and dynamic data on whole page) open in a new window - you need to assign the following code to the CONTROL.FOOTER or place it at the end of the page:

 

<script id="ExLinks" type="text/javascript">
 $jq(document).ready(function(){
   $jq("a").each(function(){
    var port = '';  
    if(this.host.indexOf(':')>=0) port = ":" + this.port;
    if(!Is?ontains(this.pathname,"\.aspx","\.htm","\.html")){
    $jq(this).attr("target","_blank");
    }
  })
});
function Is?ontains(s){
 var ret = false;
 for(var i = 1; i < arguments.length; i++){
debugger;
   if (s.search(/arguments[i]/i) > -1){
    debugger;
    var ss = s.search(/arguments[i]/i);
    ret = true;
   }
 }
 return ret;
}
</script>

Average ( Ratings):
 
Want to help out?
 
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share