kung naa mo mga pangutana about HTML, CSS, Javascript, and jQuery, pwede kaayo mo mangutana nako...
ato nang tabangan ang imong problema...
or kung mangayo ka og mga opinion about sa client-side scripting, dako kaayo ko og matabang ana...
kung naa mo mga pangutana about HTML, CSS, Javascript, and jQuery, pwede kaayo mo mangutana nako...
ato nang tabangan ang imong problema...
or kung mangayo ka og mga opinion about sa client-side scripting, dako kaayo ko og matabang ana...
How do you change input type from type="text" into type="password" upon focus?
wala man ka magsulti kung unsa na paagi imo gusto, ang pinakasayon akong ma-suggest... gamit ka og jQuery...
demoCode:$(function() { $('input.name').focus(function(){ this.type="password"; }).blur(function(){ this.type="text"; }); });
One thing to consider when doing a client-side scripting (JS) is to make i cross-browser as much as possible..
ako lang i update to make it more cross browser...
the 'this' method is a native JS object while '$(this)' is jQuery/prototype native, thou both of this still works but some browser treat this declaration differentlyCode:$(function() { $('input.name').focus(function(){ $(this).attr('type','password'); }).blur(function(){ $(this).attr('type','text'); }); });
^^^ brad gituyo ko to nga ingon ato...
kay ang this inside sa usa ka method sa jQuery is ang current element which is a DOM object...
ang type kay usa sa mga properties sa usa ka DOM object...
and it's faster to use DOM object properties.
hmmm... curious lang ko, asa na nga browser dili mogana ang akong codes? natest nimo?
you can read number 3 on this article... 14 Helpful jQuery Tricks, Notes, and Best Practices | Nettuts+
Last edited by reigel99; 07-31-2011 at 11:11 AM. Reason: added a link...
^^^ mas nindot jud bro kung ma-specific nimo... hehehe... hasta man unix sytem ako gi-mean ana..
cross browser man ako trabaho, hinuon 2 years pa lang akong experience nag-atubang anang HTML/css/javascript.... naa gihapon koy gamay siguro na wala ma-consider... pero so far, even the guys at stackoverflow.com suggests it for best practice...
I wonder how wasteful $(this) is, if it is negligible, I prefer preparing my code for future possible changes, at least it is being wrapped in a function already.
As for the question, this is more of a technology question and as I'm not following this trend quite often, HTML 5 is nearing production and I'm wondering what Javascript version will be supported and this "defer" attribute of the script tag will not introduce "undefined" objects on loading. I also think that since Javascript is the default script type, how would VBScript fits into all of this. Is there gonna be a new engine to be implemented for each browser? Or the existing engines are expected to work seamlessly which I doubt?
bay pa help.. javascript
naa koy table.
10 per page sa data scroller nako.
nya ang last row is my grand total for all the data above.
gusto nako e color ang last row and e bold ang text.
btw im using JSF+Richfaces.
TIA
Similar Threads |
|