mahdi pedram
Member since Oct 7, 2011
- Profile: /members/9089-mahdi-pedram.htm
- URL: http://mahdipedram.com
- Comments: 10
Recent Blog Comments By mahdi pedram
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 12, 2011 at 6:28 PM
@Ben I wrote a small plugin that deals with fragments. apparently jquery doesn't support it. they found it more confusing so the append only accepts Element Nodes. please take a look at this and let me know what you think. this small plugin supports both jQuery Dom Objects and native javascript D... read more »
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 12, 2011 at 2:15 PM
@ben I need to research more on how jquery deals with document fragments. this Looks like a plugin to me :) I will try to write it later tonight. Thanks alot... read more »
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 12, 2011 at 11:28 AM
the fastest way of doing this is using document fragment. so you don't need to add it an array. but your code will be pure javascript... read more »
-
Changing The Execution Context Of JavaScript Functions Using Call() And Apply()
Posted on Oct 7, 2011 at 5:16 PM
@Bob I am not passing extra arguments don't get confused I am passing the arguments that the function expects to get. Function.prototype.bind = function( context ) { var args = [].slice.call(arguments,1), fn = this; return function () { return fn.apply( context,args ); }; }; function t... read more »
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 7, 2011 at 5:10 PM
@Daniel what you have is wrong it will add an extra Comma(,). this is how I can see this code works. Really Interesting :) function createFriendNode( name ){ // Create the friend node. return "<li>" + name + "</li>"; } // Create an array of friends. var b... read more »
-
Changing The Execution Context Of JavaScript Functions Using Call() And Apply()
Posted on Oct 7, 2011 at 4:40 PM
@Ben @Bob We can say All functions in the Global Scope are Methods :)... read more »
-
Changing The Execution Context Of JavaScript Functions Using Call() And Apply()
Posted on Oct 7, 2011 at 4:37 PM
@Bob What you have for the Bind is wrong. here is the right way of doing it Function.prototype.bind = function( context ) { var args = [].slice.call(arguments,1), fn = this; return function () { return fn.apply( context,args ); }; }; so in this case this will return a new function and... read more »
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 7, 2011 at 2:44 PM
@Ben thank you Ben I agree with you. I will add this plugin to my toolkit :)... read more »
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 7, 2011 at 2:29 PM
yeah I agree, I could see using this nice plugin in larger projets not sure if $.map is faster than a regular for loop though!... read more »
-
Appending An Array Of jQuery Objects To The DOM
Posted on Oct 7, 2011 at 2:21 PM
how about // I am a convenience method for creating a Friend node // with the given name (returned as a jQuery object). function createFriendNode( name ){ // Create the friend node. return( $( "<li>" + name + "</li>" )[0]; //or $( "<li>" + name + &q... read more »