Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By pianoroad on
I am very disappointed to learn I cannot get things like banner clicks to open in a new window. I am not a programmer, but would like to understand if there is a workaround for this problem. The suggestion above about adding that code to the "theme file" would be something I'd be willing to try if I understood more about it.
Doug
Comments
Better solution is
Better solution is Javascript links which, unlike target, are acceptable in HTML 4.01 and XHTML 1.0 strict DTDs (target properly belongs only in a framed site).
The JS solution also has better usability as it degrades to a default behavior (regular link) for users with JS turned off (extra spaces in code below are to make it acceptable to Drupal - keeps getting refused for "suspicious input").
<a href="my/link" o n c l i c k = " w i n d o w . o p e n ('my/link/', 'windowName', [options]), r e t u r n f a l s e;">
window . open return false
Thanks for your reply. As I said, I am not a programmer, so not sure what that string means, but if you give me a little help with it, I think I might be able to use it.
I am trying to get my banner ads to open in a new window. So what would I do with this code string? In the future, I may want some other page to open in a new window, but for now, am mostly interested in the banners and the RSS feeds.
Thanks.
www.pianoroad.com
You would use it for your
You would use it for your links (instead of the link that uses target="_blank"). You would simply replace "/my/link" (both occurences) with the actual link you want to use.