link pages in html

Computer Science
Tutor: None Selected Time limit: 1 Day

how to link one or more than one pages in html

May 10th, 2014

<ahref="#"class="yourlink">Click Here</a>

JS:

$('a.yourlink').click(function(e){
    e.preventDefault();
    window.open('http://yoururl1.com');
    window.open('http://yoururl2.com');});

window.open also can take additional parameters. See them here: http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

You should also know that window.open is sometimes blocked by popup blockers and/or ad-filters.

Addition from Paul below: This approach also places a dependency on JavaScript being enabled. Not typically a good idea, but sometimes necessary.


May 10th, 2014

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
May 10th, 2014
...
May 10th, 2014
Mar 24th, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer