| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| New Member | Forcing external links to open in a new window Anyone know of a way to make all external links on a given site open in a new window? Maybe via css, or the htaccess file? Thanks much!
__________________ zMogo WebMaster Community |
| |
| | #2 (permalink) |
| Danltn.com | htaccess has no effect over what window links open in. The best bet would be use PHP's output buffering to 'catch' the output, then find out-going links and rewrite them as such to add the extra tag needed. I would write some code, but I'm kinda tired. Dan |
| |
| | #3 (permalink) |
| New Member | would there be a lot of code? how would i implement it site-wide? Thanks...
__________________ zMogo WebMaster Community |
| |
| | #4 (permalink) |
| i love automation | You can use the JavaScript, which is attached below ![]() It will convert all external links, and add "target=_blank" for each external link, automatically on body "onload". Kurniawan.
__________________ Xrvel | Various online tools | Free Proxy List | Hidden Proxy Partai Golkar | Noomle works : Las Vegas Airfare Last edited by xrvel; 03-07-2008 at 07:14 PM. |
| |
| | #5 (permalink) |
| NamePros Regular | If you don't have a problem, it can also be done with PHP by making a function let me know if you want that and i'll have it done for you ![]() but do note you will have to add links using that function like this for example if you want to add a new link pointing to msn.com you would have to do it this way. Code: <?php add_link("http://www.msn.com/"); ?>
__________________ Live Support : Zubair11 [at] hotmail.com Free SEO Directory! || Free Games and Songs || eBloggy.net Zubair.info || Mixcat Interactive |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |