PDA

View Full Version : getEl Help



JasonMichael
21 Feb 2007, 11:51 AM
I must be going nuts! I can't even get a simple getEl to work, after getting a datagrid to work, along with my Ajax proxy for PHP, etc etc... I feel like I've taken some tools and built a space shuttle, but now I can't even get the ignition key onto a key ring... or turn on the power swich for the interior lights...

all I'm trying to do is:

e=getEl('mydiv');
e.innerHTML='its working!';

and then in my HTML code a few lines down,

<div id='mydiv'>nothing.....still got problems, Houston...over</div>

Are there any tips or dos and don'ts for this? It looks so easy when everyone else on the web uses it.... I put alerts before and after my code, so I know the script is runnin and reaching my getEl....weird!!!

-Jason

tryanDLS
21 Feb 2007, 11:59 AM
getEl() returns an Element, not a dom object. Your code has just added an innerHTML property to e. Try e.update('blah');

refer to the doc for all the things Element provides to avoid interacting directly with the dom and having to deal with browser differences http://www.yui-ext.com/deploy/yui-ext/docs/output/YAHOO.ext.Element.html

JasonMichael
21 Feb 2007, 12:46 PM
Thank you so much tryan, that is something I would rather do.... I was just about to break down and start using

ezz=YAHOO.util.Dom.get('blah');

I think your suggestion will work fine, as I've seen it listed once before. thanks again.

Jason

(now back to doing some cool stuff with yui-ext...will post an example some day soon, I hope!)