Featured post
i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.
jQuery e.target bubbling best practice? -
in heavy-ajax code, bind "click" body tag & act depending on $(e.target)
& using $.fn.hasclass()
. when click on anchor has </span>
tag inside, $(e.target)
equals node, , not parent anchor to.
from on, have used trick (var $t = $(e.target);
) :
/** bubbling **/ if($t.get(0).tagname !== "a" && $t.get(0).tagname !== "area") { $t = $t.parent("a"); if(empty($t)) return true; //else console.log("$t.bubble()", $t); }
it feels wrong somehow... have better implementation ?
$.fn.live()
not solve issue still returns span target. i'm looking speed (running on atom-based touch devices) & live appeared way slower (twice) : http://jsperf.com/bind-vs-click/3
in fact, @guffa pointed, using $.fn.live()
solves span bubbling issue don't need event.target
anymore. guess there no other "right" answer here (using bind on container).
why not use live
method you?
$('a.someclass').live('click', function(){ // });
the live
method binds body element , checks event target against selector.
- Get link
- X
- Other Apps
Popular posts from this blog
c# - Usage of Server Side Controls in MVC Frame work -
i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.
ios - Very simple iPhone App crashes on UILabel settext -
i have simple application. have button , label in ib. have ibaction onclick calls settext on label. there's outlet label. connected in ib. crashes app first time in simulator. when launch again, sets text. crashes again next time. crashes on actual device. should simple, i'm not sure i'm doing wrong. thanks. in .h file : #import <uikit/uikit.h> @interface untitledviewcontroller : uiviewcontroller { iboutlet uilabel *label; iboutlet uibutton *button; } @property (nonatomic, retain) uilabel *label; -(ibaction) onclick1: (id) sender; @end and in .m: - (ibaction) onclick1: (id) sender { //[label settext:@"hello world!"]; label.text = @"hello world!"; //[button settitle:@"clicked" forstate:uicontrolstatenormal]; } sorry, i'm new site. how crash log , stack? thanks. edit : while answer technically correct, doesn't answer question @ :( sorry < warning - guess > if you're...
mysql - Why there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT clause? -
why there can 1 timestamp column current_timestamp in default or on update clause? create table `foo` ( `productid` int(10) unsigned not null, `addeddate` timestamp not null default current_timestamp, `updateddate` timestamp not null default current_timestamp on update current_timestamp ) engine=innodb; the error results: error code : 1293 incorrect table definition; there can 1 timestamp column current_timestamp in default or on update clause this limitation, due historical, code legacy reasons, has been lifted in recent versions of mysql: changes in mysql 5.6.5 (2012-04-10, milestone 8) previously, @ 1 timestamp column per table automatically initialized or updated current date , time. restriction has been lifted. timestamp column definition can have combination of default current_timestamp , on update current_timestamp clauses. in addition, these clauses can used datetime column definitions. more information, see automati...
Comments
Post a Comment