tag:blogger.com,1999:blog-8640596986273216089.post6467969543268769860..comments2023-08-15T06:10:51.086-03:00Comments on Ariel Flesler: jQuery.CollectionAriel Fleslerhttp://www.blogger.com/profile/17700414222186772120noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-8640596986273216089.post-31073959662258931082013-07-11T16:53:43.339-03:002013-07-11T16:53:43.339-03:00error "this.setArray is not a function"
...error "this.setArray is not a function"<br /><br />var Selections = $.collection.build();<br /> Selections.fn.init = function (listProperty, value) {<br /> return this.setArray([{<br /> listProperty: listProperty,<br /> value: value<br /> }]);<br /> };<br /><br />What am I doing wrong here? Using jQuery 2.0.2.Brucehttps://www.blogger.com/profile/18248972100160299820noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-65334043589859972662009-04-23T21:23:00.000-03:002009-04-23T21:23:00.000-03:00Hi
That note is pretty old actually... if you down...Hi<br />That note is pretty old actually... if you download any of the plugins' last versions, you'll have it all good.<br /><br />Why do you post on jQuery.Collection's post ?Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-19019127577072892912009-04-23T20:40:00.000-03:002009-04-23T20:40:00.000-03:00Yo Ariel,
I suggest you make this part of the dow...Yo Ariel,<br /><br />I suggest you make this part of the download screen for loaclScroll a LOT more obvious. Just wasted an hour messing around with localScroll on it's own trying to get it to work:<br /><br />'jQuery.LocalScroll 1.2.x requires jQuery.ScrollTo 1.3.1 or higher.<br />Since 1.2.5, you can combine with jQuery.SerialScroll(+1.2.0).<br />I really advice using the minified versions. The code is optimized for those releases. Source versions should only be used to learn. '<br /><br />Put it in red or something because I was about 10mins away from giving up.<br /><br />Thanks,<br />LLewis Litanzioshttp://www.ldexterldesign.co.uk/noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-27276671897425050532009-03-26T17:17:00.000-03:002009-03-26T17:17:00.000-03:00I had problems with this plugin in Safari 4. The i...I had problems with this plugin in Safari 4. The issue was that calling unshift on the array-like implicit arguments variable wasn't actually altering the arguments passed recusively, and resulted in an infinite loop.<BR/><BR/>I changed these two lines:<BR/><BR/>[].unshift.call( arguments, this );//insert 'this' first<BR/>return this.include.apply(this,arguments);//call again with fixed arguments<BR/><BR/>to:<BR/><BR/>var args = Array.prototype.slice.call(arguments);<BR/>args.unshift(this); //insert 'this' first<BR/>return this.include.apply(this,args);//call again with fixed argumentstimmfinhttps://www.blogger.com/profile/14463842923892799823noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-5781178668028712352008-06-30T21:53:00.000-03:002008-06-30T21:53:00.000-03:00Sure:phonogram.fn.getRandom = function(){var index...Sure:<BR/><BR/>phonogram.fn.getRandom = function(){<BR/>var index = Math.floor(Math.random() * (this.length - 1));<BR/><BR/>return this.eq( index );<BR/>};<BR/><BR/>I haven't tried it, but that should do.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-75720248820805300892008-06-30T20:51:00.000-03:002008-06-30T20:51:00.000-03:00if I have some data objects:var phonogram = $.coll...if I have some data objects:<BR/>var phonogram = $.collection.build();<BR/>phonogram.fn.init = function( index, lowercase, uppercase ){<BR/> return this.setArray([{<BR/> key: index,<BR/> hiragana: lowercase,<BR/> katakana: uppercase<BR/> }]);<BR/>};<BR/>phonogram.fn.getByKey = function( key ){<BR/> return this.filter(function(){<BR/> return this.key == key;<BR/> });<BR/>};<BR/>var vowel = phonogram()<BR/> .add('a','あ','ア')<BR/> .add('i','い','イ')<BR/> .add('u','う','ウ');<BR/><BR/>Could I get one or more random entries from an object that let me do this:<BR/>var pick = vowel.getRandom.attr('hiragana');<BR/><BR/>the result maybe is あ or い or うAnonymoushttps://www.blogger.com/profile/05809324879951221645noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-77069618518014549752008-06-13T16:24:00.000-03:002008-06-13T16:24:00.000-03:00Yes, It's due to the stack blowing up. Probably fr...Yes, It's due to the stack blowing up. Probably from too much recursion.<BR/><BR/>jQuery does a lot of recursion itself, so probably, you just added some more and it surpassed IE's limits.<BR/><BR/>It's hard to workaround, try to do less function nesting, if you are doing sort of a loop with recursion, break it with setTimeout.<BR/><BR/>This is how I fixed this problem for jQuery.Preload, check its source and Troubleshoothing.<BR/><BR/>CheersAriel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-25235382856082184432008-06-13T15:54:00.000-03:002008-06-13T15:54:00.000-03:00I get a stack overflow in IE at line 62 with JQuer...I get a stack overflow in IE at line 62 with JQuery 1.2.6. Any ideas?Anonymoushttps://www.blogger.com/profile/11872746526752675647noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-48888871715913056232008-02-04T12:31:00.000-02:002008-02-04T12:31:00.000-02:00Hi Thatcher I'm not always free, but I ...Hi Thatcher<BR/> I'm not always free, but I can get back to you at least once a day (probably more).<BR/><BR/>CheersAriel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-31158490421873914482008-02-04T11:29:00.000-02:002008-02-04T11:29:00.000-02:00Ariel, great plugin. I have decided to refactor a...Ariel, great plugin. I have decided to refactor a considerable portion of my current project to use $.collections, but because I want to do an early release in march I'm not sure if I should wait. Are you generally available to answer questions if I provide examples or is your schedule pretty crazy?<BR/><BR/>Thanks<BR/>ThatcherThatcherhttps://www.blogger.com/profile/05706801348727630948noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-1829096033949383382008-01-14T20:34:00.000-02:002008-01-14T20:34:00.000-02:00Hi Guy Yes, you can. But what you wrote is a ...Hi Guy<BR/> Yes, you can. But what you wrote is a bit wrong. In your case, users is a collection Class, not an instance. Also collections don't bring push by default, you can add it, or include from array, like in the examples. <BR/>Your code could be:<BR/><BR/>var Users = $.collection.build();<BR/>Users.fn.init = function( name, role ){<BR/> return this.setArray([{<BR/> name: name,<BR/> role: role<BR/> }]);<BR/>};<BR/>Users.fn.getByRole = function( role ){<BR/> return this.filter(function(){<BR/> return this.role == role;<BR/> });<BR/>};<BR/>var employees = Users('Joe','Moderator')<BR/> .add('Sally','Administrator');<BR/>employees.getByRole('Administrator')/* -->[{name:'Sally',role:'Administrator' }]*/<BR/><BR/>This plugin can be used in many ways, you need to remember it works like jQuery does.<BR/>Please upgrade to 1.0.2. There was a small bug that I fixed.Ariel Fleslerhttps://www.blogger.com/profile/17700414222186772120noreply@blogger.comtag:blogger.com,1999:blog-8640596986273216089.post-54950259267135489202008-01-14T19:58:00.000-02:002008-01-14T19:58:00.000-02:00Do you have an example of adding custom selectors?...Do you have an example of adding custom selectors?<BR/><BR/>For example, if I have some user objects:<BR/><BR/>var users = $.collection.build();<BR/>users.push({<BR/> name: 'Joe',<BR/> role: 'Moderator'<BR/>});<BR/>users.push({<BR/> name: 'Sally',<BR/> role: 'Administrator'<BR/>});<BR/><BR/>Could I implement a selector that would let me do this:<BR/><BR/>var admins = users('Administrator');Unknownhttps://www.blogger.com/profile/07474655406155302803noreply@blogger.com