[02/03] How to open/change new browser window
Hi all,
I have one link in my brower for training chapter.
When i click on 1st chapter of training from window1, it should open in new window named window2.
But if i click on 2nd chapter of window1 then window2 should display 2nd chapter in the same window2 rather than displaying in new window.
Re: [02/03] How to open/change new browser window
You would be using javascript. Something like this...
Code:
<html>
<script>
var win;
function OpenChapter(chapter) {
if (win) {
win.document.location.href = "test" + chapter + ".html";
} else {
win = window.open("test" + chapter + ".html", "win");
}
}
</script>
<a href="javascript:OpenChapter(1)">Chapter 1</a> <a href="javascript:OpenChapter(2)">Chapter 2</a>
</html>
Re: [02/03] How to open/change new browser window
Thanks man i really appriciate this one..