[Proto-Scripty] VERY new to Prototype, fade on mouseover using a class
Hello, This is a stupid beginner question I have a row of images with the class of highlight I would like to make them fade from 100% opacity to say 50%. I'm pretty sure i have to use the new Effect.Opacity (class, {duration:0.5, from:1.0, to:0.5}); here is what I've tried as far as javascript: script type=text/javascript Event.observe(window, 'load', function() { $$(.highlight).observe('mouseover', function() { new Effect.Opacity(.highlight, {duration:0.5, from:1.0, to: 0.5}); }); $$(.highlight).observe('mouseout', function() { new Effect.Opacity(.highlight, {duration:0.5, from:0.5, to: 1.0}); }); }); /script then my image row: table width=300 tr td a href=web/bandonrandon.php class=highlightimg src=../../ Images/portfolio/thumb_bandonrandon.jpg //a /td td a href=web/tjsherrill.php class=highlightimg src=../../ Images/portfolio/thumb_TJ.jpg //a /td td a href=web/almendrasandoval.php class=highlightimg src=../../Images/portfolio/thumb_sandoval.jpg //a /td /tr /table I believe an alternative solution would be to use the onmouseover and onmouseout to each link but i think that it would be a more bloated way of doing it. Any help on this would be great. I'm trying to get familiar with prototype. I have found jquary alternatives but I'm using prototype all over this site and don't want to load a library just for one function. Thanks, Brandon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] examine whether methode is already used
Good morning, I wanted to use the method getElementsByClassName by prototype to retrieve an array of objects. Using my Firefox 3.0.7 on Windows XP alert told me that the returned value by this method is a Nodelist, which I couldn't iterate using prototypes each-method for arrays. Prototype's api docs (http://www.prototypejs.org/api/element/ getElementsByClassName) state that the method returns an array, normally. Using google I found this link: https://developer.mozilla.org/en/DOM/document.getElementsByClassName It seems that getElementsByClassName is implemented by Firefox and prototyp and that prototype doesn't override the native implementation. When two methods with the same name are available, one in prototype and one from the browser, am I able to determine which method is used? I understand that prototype doesn't want to override native implementations of methods to not break browser compability but in this case where I use prototype to achieve that my scripts run the same way on almost every browser Firefox's impolementation of the prototype function is breaking my script because of incompatible returned data types by the two implementations of the method. I couldn't find any suggestions on how to deal with those situations. Is the only way to check for the needed data types on method returns and work around the fact that methods may be implemented in the browser nativley using different data types for return values? This would be a lot of work to do for every common function provided by prototype which could be implemented natively, too. bye basti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: examine whether methode is already used
Hi, Prototype's api docs (http://www.prototypejs.org/api/element/ getElementsByClassName) state that the method returns an array, normally. They also say As of Prototype 1.6, document.getElementsByClassName has been deprecated since native implementations return a NodeList rather than an Array. Please use $$ or Element#select instead. When two methods with the same name are available, one in prototype and one from the browser, am I able to determine which method is used? That would probably be tricky, but basically, you shouldn't have to. The Core team (now) try to avoid choosing signatures that will be similar-but-different in a future native implementation (where possible, obviously!) and as with getElementsByClassName will typically obsolete (deprecate) where that hasn't been possible, documenting the replacement. HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Apr 2, 8:57 am, basti bastian.friedr...@am-soft.de wrote: Good morning, I wanted to use the method getElementsByClassName by prototype to retrieve an array of objects. Using my Firefox 3.0.7 on Windows XP alert told me that the returned value by this method is a Nodelist, which I couldn't iterate using prototypes each-method for arrays. Prototype's api docs (http://www.prototypejs.org/api/element/ getElementsByClassName) state that the method returns an array, normally. Using google I found this link:https://developer.mozilla.org/en/DOM/document.getElementsByClassName It seems that getElementsByClassName is implemented by Firefox and prototyp and that prototype doesn't override the native implementation. When two methods with the same name are available, one in prototype and one from the browser, am I able to determine which method is used? I understand that prototype doesn't want to override native implementations of methods to not break browser compability but in this case where I use prototype to achieve that my scripts run the same way on almost every browser Firefox's impolementation of the prototype function is breaking my script because of incompatible returned data types by the two implementations of the method. I couldn't find any suggestions on how to deal with those situations. Is the only way to check for the needed data types on method returns and work around the fact that methods may be implemented in the browser nativley using different data types for return values? This would be a lot of work to do for every common function provided by prototype which could be implemented natively, too. bye basti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: $(this._element).childElements is not a function method not available
Hi Todd, You're setting this._element like this: this._element = parentDiv.select(.txt-message-panel); Element#select[1] returns an array of matching elements, not an element. I don't think $[2] accepts arrays; it accepts strings (IDs) and elements, and will accept several of them as separate arguments, but not a single argument that is an array. I think you probably meant to use down[3]. Regardless, once you've gotten an element from Prototype, it will already be extended and you don't have to pass it through $ again. [1] http://prototypejs.org/api/element/select [2] http://prototypejs.org/api/utility/dollar [3] http://prototypejs.org/api/element/down HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Apr 2, 12:34 am, Todd Nine todd.n...@gmail.com wrote: Hi all, I'm creating an AJAX controller for an Inbox and Outbox. I'm using a combination of Prototype 1.6.0.3 to encapsulate the logic within a single class, then just linking 2 instances of the class to the correct div elements using the Behaviour script API. For some reason, I'm unable to list childElements or get a child element by the select method either. All of my elements are present, and I do have child elements according to the firebug debugger. Below is my code. http://pastebin.com/f6fd30146 I always receive $(this._element).childElements is not a function method not available when line 23 runs. Is this an issue with using Behaviour to bind classes to DOM elements? Thanks, Todd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Take action after Ajax.Updater
Hi, Without knowing how you're doing the updates and such, I don't think anyone is going to be able to help. Probably need to create a simple, self-contained example demonstrating the problem. FWIW, On Apr 1, 5:20 pm, Abel Figueiredo abel.figueir...@sroque.pt wrote: Hi all. I've got two selects and an image. When I change the second one, the image updates and when i change the first one, the second is updated. The information contained in the second select is vital to choose witch image is loaded. My problem is when I change the first one, I want to trigger the image change only after the second select is altered. I've tried to use 'onSuccess' on the Ajax.Updater of the first select, I've tried to place a setTimeout on it, but it's not a good solution. It works sometimes, but there are times when the reloadImg function is triggered before updating the second select. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: having a default of no selection in drop down list
On 1 Apr., 16:23, Jay hooligan...@gmail.com wrote: ugh... I've been reading through the scriptaculous code but having no real luck figuring it out. it would be nice if I could see the demos at script.aculo.us but everytime I try to go there the page times out. There is no real demo for this kind of feature. I am wondering why no one responds to this question, though. It has come up a few times already. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Misinterpretating Effect.morph()?
On Apr 1, 5:02 pm, ferion fer...@gmx.de wrote: Hi everybody, i got another Problem wis prototype Effects are actually script.aculo.us, not Prototype, but we knew what you meant ;-) $(widget.widgetId).morph('left: 100px; top: 200px'); is working perfectly. But i do want to move the element instantly (with duration:0) so i try to reform the command to Effect.Morph(widget.widgetId,{style: 'left: 100px; top: 200px' }); This is throwing an Error (this.initalize is undefined). Same thing occurs when i try to use Effect.Move which seems to be the better effect. Look at http://wiki.github.com/madrobby/scriptaculous/effect-morph The simple form is element.morph( .. ) The complex form is new Effect.Morph(element, ... ) You're missing the 'new'. Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Misinterpretating Effect.morph()?
Olla, this is emberassing. I tryd about 10 hours yesterday, including reverse engeneering of script.aculo.us and nothing seems to work. Solution: use with new and everything works fine. Thanks for answering my stupid questions. Ferion On Apr 2, 1:09 pm, ColinFine colin.f...@pace.com wrote: On Apr 1, 5:02 pm, ferion fer...@gmx.de wrote: Hi everybody, i got another Problem wis prototype Effects are actually script.aculo.us, not Prototype, but we knew what you meant ;-) $(widget.widgetId).morph('left: 100px; top: 200px'); is working perfectly. But i do want to move the element instantly (with duration:0) so i try to reform the command to Effect.Morph(widget.widgetId,{style: 'left: 100px; top: 200px' }); This is throwing an Error (this.initalize is undefined). Same thing occurs when i try to use Effect.Move which seems to be the better effect. Look athttp://wiki.github.com/madrobby/scriptaculous/effect-morph The simple form is element.morph( .. ) The complex form is new Effect.Morph(element, ... ) You're missing the 'new'. Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: having a default of no selection in drop down list
It is odd that this question get's no response. On Apr 2, 6:43 am, claus.k...@googlemail.com claus.k...@googlemail.com wrote: On 1 Apr., 16:23, Jay hooligan...@gmail.com wrote: ugh... I've been reading through the scriptaculous code but having no real luck figuring it out. it would be nice if I could see the demos at script.aculo.us but everytime I try to go there the page times out. There is no real demo for this kind of feature. I am wondering why no one responds to this question, though. It has come up a few times already. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: having a default of no selection in drop down list
Try a ruby(or whatever that code is) forum or paste in the source from firefox after it has been interpreted. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: examine whether methode is already used
$$('.ClassNameToGet') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Associative arrays vs hash
I'm building the following array: var ax = [] ax['aaa'] = 1 ax['aab'] = 2 ax['aac'] = 4 ax['aad'] = 6 I would like to loop though all of the values in this array. If I do the following, I get nothing: ax.each(function(s) { alert(s) }) ...but if I do the following, I get my values, followed by all the names of the Prototype enumerable method names. for(s in ax) { alert(s) } I've even tried this, which behaves in a similar manner: var ah = $H(ax) ah.each(function(s) { alert(s) }) What am I doing wrong here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Associative arrays vs hash
Diodeus wrote: I'm building the following array: var ax = [] ax['aaa'] = 1 ax['aab'] = 2 ax['aac'] = 4 ax['aad'] = 6 I would like to loop though all of the values in this array. [...] What am I doing wrong here? You use an Array while you should use either Hash, or plain javascript object. The Arrays in javascript were never intended to be associative arrays as in PHP. They are simple numeric arrays. Notice that the .length property of an array does not change if you add a key to it. It only changes if you add an element to the end of an array. Try the fallowing: var ax = $H({ 'aaa': 1, 'aab': 2, 'aac': 3 }); ax.set('aad',4); ax.get('aab'); //returns 2 This is the Hash[1] which is extended with Enumerable[2] mixin. You can use .each method and any other Enumerable gooddies thanks to that: ax.each(function(pair) { console.log( pair.key + ': ' + pair.value); //prints aaa: 1, aab: 2 //and all the other entries in Firebug console. }); The for .. in loop you mentioned isn't expected to loop throug an array, but through all teh properties of an object. You can read more on it on the unofficial wiki[3]. [1] http://prototypejs.org/api/hash [2] http://prototypejs.org/api/enumerable [3] http://proto-scripty.wikidot.com/prototype:tip-looping-through-arrays -- Best Regards, SWilk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Associative arrays vs hash
The problem is in my case, I'm adding elements to the array as I go, as opposed to building it as a JSON-type hash up front. I'd like to be able to do: ax[newValue] = y Looping through an associative array should be simple, but I'm missing something here. On Apr 2, 10:38 am, Walter Lee Davis wa...@wdstudio.com wrote: I wasn't aware that JavaScript arrays could be associative like this. My understanding was that they are always numerically indexed, and if you want an associative array-like structure that you can iterate over, you should use a vanilla Object or a Prototype Hash. var ax = {'aaa':1,'aab':2,'aac':4,'aad',6} for(i in ax){ alert( i + ': ' + ax[i] ); } var ax = $H({'aaa':1,'aab':2,'aac':4,'aad',6}); ax.each(function(s){ alert( s ) }); Walter On Apr 2, 2009, at 10:28 AM, Diodeus wrote: 'm building the following array: var ax = [] ax['aaa'] = 1 ax['aab'] = 2 ax['aac'] = 4 ax['aad'] = 6 I would like to loop though all of the values in this array. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Associative arrays vs hash
The problem is that: obj = []; obj['foo'] is not an associative array, and it is not a hash. It is an empty array with the property of foo, identical to this notation: obj.foo The length property refers to the items in the array, not the properties associated with it. for (each in obj) iterates over all of the properties/methods in an object, and Prototype adds a bunch of those to the prototypes of arrays. It does not add any to the prototype of an object, so try: var ax = {}; ax['aaa'] = 1; ax['aab'] = 2; ax['aac'] = 4; ax['aad'] = 6; for (each in ax) { alert(x); } Cheers, Josh Powell On Apr 2, 8:09 am, Alex Mcauley webmas...@thecarmarketplace.com wrote: why not push into the json object ? - Original Message - From: Diodeus diod...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, April 02, 2009 4:04 PM Subject: [Proto-Scripty] Re: Associative arrays vs hash The problem is in my case, I'm adding elements to the array as I go, as opposed to building it as a JSON-type hash up front. I'd like to be able to do: ax[newValue] = y Looping through an associative array should be simple, but I'm missing something here. On Apr 2, 10:38 am, Walter Lee Davis wa...@wdstudio.com wrote: I wasn't aware that JavaScript arrays could be associative like this. My understanding was that they are always numerically indexed, and if you want an associative array-like structure that you can iterate over, you should use a vanilla Object or a Prototype Hash. var ax = {'aaa':1,'aab':2,'aac':4,'aad',6} for(i in ax){ alert( i + ': ' + ax[i] ); } var ax = $H({'aaa':1,'aab':2,'aac':4,'aad',6}); ax.each(function(s){ alert( s ) }); Walter On Apr 2, 2009, at 10:28 AM, Diodeus wrote: 'm building the following array: var ax = [] ax['aaa'] = 1 ax['aab'] = 2 ax['aac'] = 4 ax['aad'] = 6 I would like to loop though all of the values in this array. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Associative arrays vs hash
Yes, you're right, of course. I'm going to use Szymon's method. It just seems that it's a bit of a song-and-dance to do something that you'd assume would be handled in the native functionality of JavaScript arrays. On Apr 2, 11:30 am, Walter Lee Davis wa...@wdstudio.com wrote: What's missing is associative arrays in JavaScript. As to adding elements in a (Prototype) Hash, Szymon already gave you that: ax.set('aad',4); And there's a matching get() function to pluck an individual element out of the Hash, too. ax.get('aad') //-- 4 Walter On Apr 2, 2009, at 11:04 AM, Diodeus wrote: The problem is in my case, I'm adding elements to the array as I go, as opposed to building it as a JSON-type hash up front. I'd like to be able to do: ax[newValue] = y Looping through an associative array should be simple, but I'm missing something here. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Associative arrays vs hash
I know, growing up as I did in PHP, I have always thought that its model of Array() was normal too. But JavaScript is a different, weird beast. Walter On Apr 2, 2009, at 11:39 AM, Diodeus wrote: It just seems that it's a bit of a song-and-dance to do something that you'd assume would be handled in the native functionality of JavaScript arrays. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Autocompleter selection container disappears on IE 7
I've encountered the following bizarre behaviour with IE7. I'd appreciate any input from someone who understands it or has seen it before. Problem: The dropdown container that holds the selections appears and disappears immediately. I've isolated it to the following: If the text on the page immediately preceding the autocomplete div is 'too' wide, then the autocompleter breaks in the manner described. If I narrow down the text preceding the autocomplete div, then it works. Example: this fails: h2Departure City/h2 %= f.text_field 'org_airport', :size = 20, :class = 'inputborder' % div class=auto_complete id=air_travel_record_org_airport_auto_complete /div %= auto_complete_field :air_travel_record_org_airport, :url={:controller='airports', :action='autocomplete_airport_org_city'}, :after_update_element='update_air_travel_record_view' % this succeeds: h2From/h2 %= f.text_field 'org_airport', :size = 20, :class = 'inputborder' % div class=auto_complete id=air_travel_record_org_airport_auto_complete /div %= auto_complete_field :air_travel_record_org_airport, :url={:controller='airports', :action='autocomplete_airport_org_city'}, :after_update_element='update_air_travel_record_view' % Any advice? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Select form elements by name
was wrong, I'm sorry - this is right $$('#billship input[type=radio] [name=shipType]') On 2 апр, 14:29, ColinFine colin.f...@pace.com wrote: On Apr 1, 8:44 pm, buda www...@pochta.ru wrote: $$('#billship input:radio[name=shipType]'); Buda, are you saying that $$ (and hence CSS selectors) understand the notation input:radio for input[type='radio']? Because I cannot find any evidence that this is so. Colin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: registering observers with classes using $$
and idProjectListTBL.$$('classProjectsEditA').invoke(observe, click, editProjectRecord); must be idProjectListTBL.select('.classProjectsEditA').invoke(observe, click, editProjectRecord); I recommend you read those from the manual (they are really helpfull too): http://prototypejs.org/api/element/select http://prototypejs.org/api/element/previous http://prototypejs.org/api/element/down http://prototypejs.org/api/element/next http://prototypejs.org/api/element/next --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] url query string
Does prototype or scriptaculous offer a way to parse a query string in a URL? I am creating a simple page that will redirect a user as a band aid for poor programming choices made by a vendor. I need this to all be done in JavaScript. I found several solutions on Google but wondered if prototype had a more elegant solution. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: examine whether methode is already used
On Apr 2, 5:57 pm, basti bastian.friedr...@am-soft.de wrote: Good morning, I wanted to use the method getElementsByClassName by prototype to retrieve an array of objects. Using my Firefox 3.0.7 on Windows XP alert told me that the returned value by this method is a Nodelist, which I couldn't iterate using prototypes each-method for arrays. You can convert the retuned NodeList to an array using $A(), or if you want to be a little clever you can test the returned object's constructor and only convert non-Arrays: var nodes = document.getElementsByClassName('foo'); if (nodes.constructor != Array) { nodes = $A(nodes); } The host getElementsByClassName is likely much faster in general than a native javascript replacement. HTML 5 includes a selector API that will provide host methods for a much greater range of selectors, they should offer significant speed enhancements over current native selector APIs. URL: http://www.w3.org/TR/selectors-api/ -- Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: url query string
You might like this: http://prototypejs.org/api/string/toQueryParams Walter On Apr 2, 2009, at 6:02 PM, Russell Keith wrote: Does prototype or scriptaculous offer a way to parse a query string in a URL? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] how detect change in field value
Hi list I have the follow code: HTML: form input type=text name=field1 id=field1 / input type=hidden name=hide1 id=hide1 / a href=# id=field1_showoptionsshow options/a /form JS: myclass=Class.create(); myclass.addMethods({ showoptions: function(){ //show options using windows_js_1.3 //In the windows change the value from field1 }, getData: function(evt){ var number=evt.element().value; //made a ajax request and fill hide1 field looking number how key } }); document.observe('dom:loaded', function(){ $('field1_showoptions').observe('click', myclass.showoptions); $('field1').observe('change', myclass.getData); }); I want three thing 1: have a window with a table filled with many options and descriptions: OK 2: fill hide1 field when field1 value has enter manually: OK 3: fill hide1 field when field1 value has change using code js: FAIL Someone can give me a tip? -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---