Xurion Posted August 31, 2007 Share Posted August 31, 2007 Hi all, Lets assume I have domain.com, and the site hosted there has many links that either link to pages within itself, or pages on different domains. Is there a way for all external links to open up in a new window, and have all local links open up in the same window? What I am looking for is a global way to set this rather than specifying every external link with a target="_blank" attribute manually. Thanks in advance. Xur~ Quote Link to comment https://forums.phpfreaks.com/topic/67435-external-links-opening-up-in-a-new-window/ Share on other sites More sharing options...
mosey Posted August 31, 2007 Share Posted August 31, 2007 If you've used/are using Wordpress, there is a plugin that changes outgoing links to e.g. open in new windows. http://www.semiologic.com/software/publishing/external-links/ Perhaps that could be used as a reference for further work? Quote Link to comment https://forums.phpfreaks.com/topic/67435-external-links-opening-up-in-a-new-window/#findComment-338609 Share on other sites More sharing options...
ToonMariner Posted August 31, 2007 Share Posted August 31, 2007 opening new windows is considered a docuemnt effect and as such should be controlled by javascript. http://www.quirksmode.org/js/events_advanced.html gives details on how to add eventhandlers to elements - use that to add the onclick and onkeypres eventhandlers and make tehm open a newwindow - note microsofts implementation means the 'this' object reference is useless - which is pretty bloody useless in itself if you ask me (another 'feather' in the MS cap). Quote Link to comment https://forums.phpfreaks.com/topic/67435-external-links-opening-up-in-a-new-window/#findComment-338623 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.