Topic: understanding tutorial "onKeyUp request buffering"

Hi,

I am reading the tutorial http://xajaxproject.org/en/docs-tutoria … buffering/ and I don't understand the meaning of the expression "xajax.$(strId).value". I think, $ is the name of a core functiion (unusual, but possible, hmm...) in the xajax core? What does this function do, how can I understand it?

Ralph

Re: understanding tutorial "onKeyUp request buffering"

Hi,

xajax.$() is a shorthand for getElementById.

So xajax.$(strid).value returns the value of the element whose id="strid".

In the turotial strid is the id passed as a parameter.

If you want to refer directly to an element you need to quote the param like

a = xajax.$('elementid').value;

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: understanding tutorial "onKeyUp request buffering"

Thanks, I have never seen it before. But what is the difference between

a = xajax.$('elementid').value;

(with 'xajax.' as prefix = class identifier) and

a = document.getElementById('elementid').value;

? When I looked into the sourcees of xajax, I first thought $() is a special function like a 'wrapper' or so. Where $() is described as a shorthand? It is not JavaScript standard, isn't it?

Thanks Ed,
Ralph

EDIT: "by a little help of my friends" I found the lines  334 and 3508 in the uncompressed core of version 0.6. Yes,
xajax.$('elementid') == document.getElementById('elementid'), _if_it_exists_.

Last edited by rollo27 (2009-07-23 1:35:16 PM)