SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How to make links with target=blank xhtml-strict?
When you want to make your XOOPS xhtml-strict you have to watch out for a few things that differ from xhtml-transitional. One of these things is that target=blank is not allowed in xhtml-strict. I know that making XOOPS xhtml-strict is ahead of time, since XOOPS struggles to be xhtml-transitional, but I wanted to let you know. Add this function between the head-tags of your theme:
<script type="text/javascript">
<!--
function 
externalLinks() {
 if (!
document.getElementsByTagName) return;
 var 
anchors document.getElementsByTagName("a");
 for (var 
i=0i<anchors.lengthi++) {
   var 
anchor anchors[i];
   if (
anchor.getAttribute("href") &&
       
anchor.getAttribute("rel") == "external")
     
anchor.target "_blank";
 }
}
//-->
</script>
Also there must be an onload of this function inside the body-tag, like:
<body onload="externalLinks();">
Also class/module.textsanitizer.php must be changed. Look for
target="_blank"
and replace with
rel="external"
And this is the method how links that have to be opened in a new window must be written. Just add rel="external" to any link that has to open in a new window. I must confess that I don't know where the credits for the above snippet have to go to and how to place the function more elegant.


The comments are owned by the author. We aren't responsible for their content.
user

 specific menu item


from all that code in the module.textsanitzer.php how can I know which is the specific item I want to replace with rel="external" ?

 


Login

Who's Online

98 user(s) are online (1 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 98


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Did you know ?

There are many support sites in different languages across the world?

Random question

I really liked a file and I would like to send it to a friend. How can I do that?