ecommerce website design Shropshire, Custom & Ecommerce Website Designers, Web Page Design Company Shropshire UK Site Map
Phone:01743 272 609 Fax: 0709 286 1166
Home page, website design service at Shrewsbury, Shropshire. We supply website design service to business in Shropshire and whole UKAbout spark computing, website design service at Shrewsbury, Shropshire. We supply website design service to business in Shropshire and whole UKExpertise and services from spark computing, website design service at Shrewsbury, Shropshire. We supply website design service to business in Shropshire and whole UKOffice automatic solutions, online business solutions supplied by Spark computing, shrewsbury, shropshirecontact spark computing, shrewsbury, shroshire to discuss online business websites, custom software development

Open link in a new window or tab

14/10/10

Permalink 12:31:43 am, Categories: Website design  

Open link in a new window or tab

Using old basic javascript it is very simple to open a link or new page on a new window.

Code:

window.open('http://www.pageresource.com/jscript/jex5.htm','mywindow','width=400,height=200')

Below is a list of the attributes you can use:

1. width=300
Use this to define the width of the new window.

2. height=200
Use this to define the height of the new window.

3. resizable=yes or no
Use this to control whether or not you want the user to be able to resize the window.

4. scrollbars=yes or no
This lets you decide whether or not to have scrollbars on the window.

5. toolbar=yes or no
Whether or not the new window should have the browser navigation bar at the top (The back, foward, stop buttons..etc.).

6. location=yes or no
Whether or not you wish to show the location box with the current url (The place to type http://address).

7. directories=yes or no
Whether or not the window should show the extra buttons. (what’s cool, personal buttons, etc…).

8. status=yes or no
Whether or not to show the window status bar at the bottom of the window.

9. menubar=yes or no
Whether or not to show the menus at the top of the window (File, Edit, etc…).

10. copyhistory=yes or no
Whether or not to copy the old browser window’s history list to the new window.

You can use Jquery to force all links in the page will open the target page in a new window:

Code:

<script type="text/javacript">
  var $j = jQuery.noConflict();
$j(document).ready(function() {
//external attribute
$j("a:not([@href*=http://YOURSITE.com/])").not("[href^=#]")
.addClass("external")
.attr({ target: "_blank" });
} );
</script>

Tweet this! Facebook Live Yahoo bookmark Digg US google bookmark

Trackback address for this post:

http://www.sparkcomputing.co.uk/blogs/htsrv/trackback.php?tb_id=81

Trackbacks, Pingbacks:

No Trackbacks/Pingbacks for this post yet...

February 2020
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29  

Spark Website Design, Shropshire

Technical articles on IT solutions.

Free information on office and home IT solutions; How to get a website running for your business; self-help e-commerce; and tips on website design.

Search

Misc

XML Feeds

What is this?