News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Coding tip for next Beta

Started by Skoen, April 13, 2004, 08:55:48 PM

Previous topic - Next topic

Skoen

I'm currently working on creating a new homepage and have found some tricks that should be able to validate in XHTML as well and work perfect in all three browsers.

How about the following changes:

<edit file>
Sources/Sub.php
</edit file>

<search for>
'<a href="$1" target="_blank">$1</a>',
                        '<a href="$1" target="_blank">$2</a>',
</search for>

<replace>
'<a href="$1" title="$1" onclick="void(window.open(this.href,\'\',\'\')); return false;">$1</a>',
                        '<a href="$1" title="$2" onclick="void(window.open(this.href,\'\',\'\')); return false;">$2</a>',
</replace>

<search for>
                        '<img src="$1" alt="" border="0" />',
                        '<img src="$3" alt="" border="0" width="$1" height="$2" />',
                        '<img src="$2" alt="" border="0" width="$1" />',
                        '<img src="$3" alt="" border="0" width="$2" height="$1" />',
                        '<img src="$2" alt="" border="0" height="$1" />',
</search for>

<replace>
                        '<img src="$1" alt="" style="border:0px;" />',
                        '<img src="$3" alt="" style="border:0px;" width="$1" height="$2" />',
                        '<img src="$2" alt="" style="border:0px;" width="$1" />',
                        '<img src="$3" alt="" style="border:0px;" width="$2" height="$1" />',
                        '<img src="$2" alt="" style="border:0px;" height="$1" />',
</replace>


These changes made my page validate in HTML 4.01 Strict.
Alf Otto 'Skoen' Fagermo
Retired Norwegian translator


[Unknown]

Support for 4.01 strict and XHTML 1.1, etc. are not priorities right now.

-[Unknown]

Jack.R.Abbit™

Quote from: Skoen on April 13, 2004, 08:55:48 PM...and work perfect in all three browsers
I didn't realize the field had been narrowed down to three...  :P

Advertisement: