extjs - Getting a single element with JQuery and SenchaTouch -
i'm writing article on senchatouch , want compare basic ext.get equivalent in jquery. i'm little confused , want make sure right.
in senchatouch, setthe innerhtml use ext.get , pass element want. in jquery, pass css selector? (i assume # does). right on this? in jquery, there way same "getelementbyid" type thing?
also, i'm little confused on why jquery not returning array? because there can 1 item marked same id in dom?
i know, kind of novice questions, want make sure undestand correctly.
ext.application({ name: 'myapp', launch: function () { ext.get('div1').sethtml('ext set this'); } }); $(document).ready(function () { $('#div2').html('jquery set this'); });
document.getelementbyid()
returns dom element, it's native javascript , more faster ext.get()
or $(#id)
$('#id')
type of jquery selector won't return array, returns jquery object allow call whatever jquery methods supposed affect elements found. never returns null if jquery object contains no elements, treated empty object , nothing.
so basically, ext.get() not same document.getelementbyid()
in javascript or $('#id')
in jquery since allow more id
existing htmlelement, or ext.element
.
Comments
Post a Comment