[thelist] XHTML 1.0 Strict -no target attribute allowed?

Mark Groen markgroen at gmail.com
Sat Oct 23 09:40:05 CDT 2004


On Sat, 23 Oct 2004 14:23:12 +0100, Julia <> wrote:
> At 03:46 23/10/2004, you wrote:

> Could you tell me exactly how I put this "in a function that is
> body.onloaded" and how I call it in body onload?
> I have tried calling the function:
> 
> function newWin()
> then onclick =newWin()
> 
> and then putting that in body onload but it doesnt work.
> thanks again,
> Julia
> (goes away humbly to read basic javascript tutorials.....)

You are sort of on the right track, almost...

The part you're missing I think is the javascript is loaded in the
head section as a general rule for this sort of thing, not through the
onload function.

Since you are only validating for 1.0, you can use this in your head
section, or just have the script part in a seperate file, it's just a
pop-up script with everything enabled.

<script type="text/javascript">
<!-- hide from older browsers
    function openWin(vUrl,vTarget)
    {
      n = open(vUrl,vTarget,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
    }
  // -->
</script>

Your link in the body section:

<a href="yourfile.html" title="a description of what the visitor will
be clicking to" onclick="openWin(this.href, this.target); return
false;">some text to click on</a>


cheers,

             Mark

             MG Web Services
             www.mgwebservices.ca

Your Canadian West Coast web site development and hosting solution.


More information about the thelist mailing list