SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: Popup similar at sitepoint
-
Oct 13, 2007, 05:07 #1
- Join Date
- Aug 2007
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Popup similar at sitepoint
Hello
i find a javascript similar that used on this forum
When i do a click on link first time i open a popup after i click i go on click link
It's difficult find this script ?
-
Oct 14, 2007, 02:45 #2
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
View the source of the script here and figure out how it works. JavaScript is "open source" by necessity... you can always read any site's JavaScript.
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Oct 14, 2007, 04:29 #3
- Join Date
- Aug 2007
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thank for reply. I have try to read the javascript but i am not able to obtain the necessary code
What kind of javascript can i find on google ??
-
Oct 14, 2007, 12:25 #4
write this code to save labour
This is not difficult make this code.
-
Oct 14, 2007, 12:48 #5
- Join Date
- Aug 2007
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i am not able to do this code.
Have you the javascript ?
-
Oct 15, 2007, 11:50 #6
This is very usual example, i test this script with FF.
Code HTML4Strict:<html> <head> <title>test</title> </head> <script> var win; function oSimple() { this.status = new Array(); this.index = 0; } oSimple.prototype.Act = function(_index, _href) { switch( this.status[_index] ) { case 0: win = window.open(_href, "zxzx", "top=100, left=100, width=200, height=400", false); this.status[_index]++; return false; break; case 1: if ( typeof win == "object" ) { win.close(); } window.location = _href; return; break; } return; } oSimple.prototype.assignObject = function(_point) { this.index++; this.status[this.index] = _point; return this.index; } </script> <body> <a href="http://google.com" >google</a><br/> <a href="http://yahoo.com" >yahoo</a><br/> <script> var oLink = new oSimple(); var obj = document.getElementsByTagName("a"); for ( var i = 0; i < obj.length; i++ ) { obj.item(i).setAttribute("onclick", "oLink.Act("+(oLink.assignObject(0))+", this.href); return false;"); } </script> </body> </html>
-
Oct 15, 2007, 13:28 #7
- Join Date
- Aug 2007
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you for the script.
But if i want open in popup for example the url www.msn.com and not yahoo or google is it possibile ?
-
Oct 15, 2007, 23:55 #8
Yes, It is valid for all correct urls ( msn, hotmail, mail.ru, yandex.ru, cnn, bbc, localhost, ... ).
-
Oct 16, 2007, 15:03 #9
- Join Date
- Aug 2007
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes ok
but i want that if i click on www.yahoo.com and my popunder is www.msn.com at the first click open msn and not yahoo and at second click open yahoo
Is it possible ?
-
Oct 19, 2007, 15:14 #10
- Join Date
- Aug 2007
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i havent' resolved with my problem
can you help me again ?
Bookmarks