You are here: Re: DOM doc - simple find element PHP+JS « PHP Programming Language « IT news, forums, messages
Re: DOM doc - simple find element PHP+JS

Posted by Jasen Betts on 01/24/06 08:48

> thanks Jasen! thats what I am looking for.
> BUT the book I am looking at says that the onload() handler for a SCRIPT
> element is a Microsoft extension, not DOM spec. I need to work with
> Firefox. ;-)

firefox supports it too, (well mozilla did last month... when I tried it)
onreadystatechange is an IE extension and is IE only.

> Can I do a ScriptElem.setAttribute() and attach an onload() handler?

You don't need setAttribute,

ScriptElem.onload=onLoadFunction;

having previously done

function onLoadFunction(){ /* your code here */ }

or similar

> I am trying to check the DOM level 2 ref at
> http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
>
> but its really hard to read.

I wasn't aware that dynamically loading script was actually covered by the
standard.

This code works in mozilla:

function pastejs(url,onloadfunc){
var s = document.createElement("script");
s.onload=onloadfunc;
s.type = "text/javascript";
s.src = url;
document.body.appendChild(s);
}

Bye.
Jasen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация