Posted by Michael Winter on 05/05/06 13:16
On 05/05/2006 09:46, Jeremy Brown wrote:
> Thank you for the assistance.
You're welcome. However, please do not top-post and full-quote to this
group in future.
How do I quote correctly in Usenet?
<http://www.netmeister.org/news/learn2quote2.html>
You might want to investigate OE-QuoteFix
(<http://home.in.tum.de/~jain/software/oe-quotefix/>).
[Corrected this once:]
> "Michael Winter" <m.winter@blueyonder.co.uk> wrote in message
> news:WMr6g.64211$wl.8160@text.news.blueyonder.co.uk...
>
>> function modifyWebringTargets() {
>> var ring;
>>
>> if (document.getElementById
>> && (ring = document.getElementById('webring'))
>> && ring.getElementsByTagName) {
>> var links = ring.getElementsByTagName('a');
>>
>> for (var i = 0; i < links.length; ++i) {
>> links[i].target = 'webring';
>> }
>> }
>> }
>
> Where in the would I put this script?
In a script element as a child of the head element will do:
<head>
<!-- ... -->
<script type="text/javascript">
function modifyWebringTargets() {
/* ... */
}
</script>
<!-- ... -->
</head>
You then have the option of calling the function in response to the load
event:
<body onload="modifyWebringTargets();">
or in a script element at the end of the document:
<!-- ... -->
<script type="text/javascript">
modifyWebringTargets();
</script>
</body>
</html>
The difference between the two is that in the former, the function will
be called after the entire document has finished loading, including any
images and the like. The latter example will call the function once the
script element has been parsed; more or less once all of the markup has
been received.
Hope that helps,
Mike
--
Michael Winter
Prefix subject with [News] before replying by e-mail.
[Back to original message]
|