Re: [Proto-Scripty] Another help with $$ needed
What you are looking for is http://api.prototypejs.org/language/enumerable/prototype/invoke/ Sent from my iPad On Apr 19, 2010, at 10:23 PM, Ran Berenfeld berenfeld...@gmail.com wrote: Hello Is there a way to do something like $$(xxx).hide() ? (instead of iteration over the array) i.e extend the Array JS object with some more functions ? I have many places that are doing the same thing (iterating on the array to call a method) -- 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-scriptacul...@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. -- 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-scriptacul...@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.
Re: [Proto-Scripty] Return From Each Loop
What you probably want is other enumerable methods, such as http://www.prototypejs.org/api/enumerable/any On Apr 13, 2010, at 11:53 AM, sporkit minchuk.j...@gmail.com wrote: I'm trying to validate that at least one checkbox of 4 has been selected. The code seems simple enough to me. function testRecipient() { var required = [dir, dev, pub, web]; required.each( function (name) { if ( $(name).checked == true ) return true; }); alert('Please select at least one recpipient for your email.'); return false; } Shouldn't returning true exit directly from the function? Even if I reach the return true statement, the function keeps looping until it reaches the alert and returns false. I could probably throw $break, but I feel as if I'm missing something really important here... Thanks!!! -- 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-scriptacul...@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. -- 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-scriptacul...@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.
Re: [Proto-Scripty] Re: Effect.Morph applied to background image
That is all i can think of. Quite heavy handed to have such a transition, but doable. Possibly always have a clone behind the transitioning element and just morph the opacity of the one on top anytime you want to change the background. Btw, the reason morph only effects what it does is that the only things that can easily calculate in between stages are effected. Ie, you cannot 'tween' the change of typesets, either. On Apr 11, 2010, at 1:20 PM, Jinsa jf.wesq...@gmail.com wrote: Hey Junkshops :) First I would thank you for your answer. The setStyle may solve the problem linked to the background image (what a shame that morph don't work with bgimage :/) but the problem is that I won't get the morph effect between the bakground change which is what I am searching for. I'm thinking of a clone appearing as the same time the real one disappears but it seems very complicated to solve a tiny problem right? The size change is just a fact I've put in order to check the effect.morph was running, in real case I don't need it. That sounds quite a deal to do some bgimage morphing, do you have some idea in order to make it? Enjoy your night, Jinsa ;) On 11 avr, 17:18, Junkshops junksh...@gmail.com wrote: According to the wiki:http://wiki.github.com/madrobby/scriptaculous/effect-morph ...morph only works on length and color based attributes, so it won't switch the background image for you. Why don't you just use setStyle on the containing element and then use morph to change the size? Cheers, Junk On Apr 11, 7:48 am, Jinsa jf.wesq...@gmail.com wrote: Anyone may have a clue? :( -- 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-scriptacul...@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. -- 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-scriptacul...@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.
Re: [Proto-Scripty] The Unofficial Wiki
If it becomes easy to contribute to the official page then yes, that's the ideal answer as it's easier to find. If it wasn't for this group, I wouldn't have known about your wiki. On Apr 8, 2010, at 6:23 AM, T.J. Crowder t...@crowdersoftware.com wrote: Hi folks, As many of you know, we've had an unofficial Prototype script.aculo.us wiki for about 18 months: http://proto-scripty.wikidot.com/ I have a question for the community, but first a preamble. Preamble: In the last year (more, actually), there's been precisely one edit by someone other than me. :-) (Doug Reeder added an on0 handler to the bulletproof ajax page.) I wrote the vast majority of the articles and have been very nearly the only person maintaining them, not that there's been a lot to do on that front. (Don't get the impression I mind; I don't.) This suggests to me that - 1. We don't need a wiki or 2. We do, but it's too hard to contribute to that one because you have to request access and wait for it to be granted As a side note: Tobie and the core team are working on moving the main Prototype website to GitHub (don't worry, the URL doesn't change) from the current CMS it's on (Mephisto), and Tobie says that it will be a lot easier for people to contribute official content to the website once that's done. Question: Do we need a wiki with user-generated content? Or should we just move all of the relevant content to the Prototype website and make sure the process for contributing to the website is well-publicized, easy, and efficient? Thanks, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com -- 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-scriptacul...@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. -- 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-scriptacul...@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.
Re: [Proto-Scripty] can Request be used to track navigation clicks asynchronously?
Don't see why not though it'd slow down the user experience a bit (not necessarily a good thing). Have the onclick block, send data to server, server responds, then in the Ajax callback send user to the destination via window.location Note: I haven't done this, it's just an off the top of my head suggestion. Sent from my phone so please pardon any spelling errors. On Feb 15, 2010, at 8:28 PM, manfmnantucket manfmnantuc...@gmail.com wrote: Hi all, I'm trying to use Prototype to do asynchronous click-tracking... that is, to log a server record each time a user clicks a link to navigate to another page. I've set the link onclick up to call a simple function which makes an Ajax.Request to send the data without blocking. However usually the server never gets the data, I think because the current page Unloads before Request can complete. What's the correct way to accomplish this? Is there a way to make page Unload wait until the Request is sent (but not until the server responds)?? thanks! -- 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 . -- 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-scriptacul...@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.
Re: [Proto-Scripty] Re: get a file from intranet server
Prototype runs on the client (ie webbrowser) rather than the server. I wish we could help you but the answer depends on the webserver you are running and it's configuration. You really should go through the support channels for your server. Sent from my phone so please pardon any spelling errors. On Feb 10, 2010, at 12:23 PM, albert kao albertk...@gmail.com wrote: On Feb 9, 4:13 pm, DJ Mangus d.man...@gmail.com wrote: I'm confused. Are you wanting to call up a local file? Or are you running a webserver on that vista machine? You really should install a webserver on the machine first and then ask in the place where they support your server rather than hereas this question isn't really about prototype. Sent from my phone so please pardon any spelling errors. On Feb 9, 2010, at 8:02 AM, albert kao albertk...@gmail.com wrote: How to get (download) a file from intranet server with Prototype ? e.g. the file is C:\dir1\data.txt and the Windows Vista server IP address is 192.168.0.112. -- 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 athttp://groups.google.com/ group/prototype-scriptaculous?hl=en . I apologize for the confusion. I like to download a file (C:\dir1\data.txt) from server (IP address 192.168.0.112) to my local machine which is running a Prototype javascript. How to do that? -- 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 . -- 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-scriptacul...@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.
Re: [Proto-Scripty] divide one long table into multiple 40 rows
That really should be handled serverside IMO. Otherwise all the data is downloaded upon initial page call when all you need is one page worth at that point. Sent from my phone so please pardon any spelling errors. On Feb 9, 2010, at 10:20 AM, albert kao albertk...@gmail.com wrote: Instead of displaying one long table with many rows and use the scroll bar to look at the data. Is it possible to divide the table so that each screen will display at most 40 rows? The user click the Next, Previous buttons to go to the next or previous page. or the 1, 2, 3, ... to go to any page directly Any sample code available? -- 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 . -- 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-scriptacul...@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.
Re: [Proto-Scripty] get a file from intranet server
I'm confused. Are you wanting to call up a local file? Or are you running a webserver on that vista machine? You really should install a webserver on the machine first and then ask in the place where they support your server rather than hereas this question isn't really about prototype. Sent from my phone so please pardon any spelling errors. On Feb 9, 2010, at 8:02 AM, albert kao albertk...@gmail.com wrote: How to get (download) a file from intranet server with Prototype ? e.g. the file is C:\dir1\data.txt and the Windows Vista server IP address is 192.168.0.112. -- 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 . -- 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-scriptacul...@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.
Re: [Proto-Scripty] Event.element
What is returned is the same thing you'd get if you used $('id'). Chain on .identify to get the Id from a DOM node. On Sunday, January 10, 2010, bill will...@techservsys.com wrote: The docs say: Event.element(event) - Element Returns the DOM element on which the event occurred. But, what is actually returned ? If not the ID, what do I do to get the id of the div in which the click occurred ? -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptacul...@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.
Re: [Proto-Scripty] Event.element
Either should work fine. No need for a variable though. It's what makes prototype so nice. Sent from my phone so please pardon any spelling errors. On Jan 10, 2010, at 11:08 AM, bill will...@techservsys.com wrote: DJ Mangus wrote: What is returned is the same thing you'd get if you used $('id'). Chain on .identify to get the Id from a DOM node. Thank you. as in: function clickHander (event) { var id = event.element().identify ? or rather: function clickHander (event) { var element= event.element() var id = element.identify() ? ... -- Bill Drescher william {at} TechServSys {dot} com -- 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 . -- 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-scriptacul...@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: Setting focus after Ajax.Updater complete?
If the id 'editdescription' is added to the DOM it won't have been processed by the browser OnComplete. You will have to delay the function. Sent from my phone so pardon the spelling errors. On Sep 27, 2009, at 10:59 PM, Steve Marshall ste...@westnet.net.au wrote: Hi all. I'm brand-new to Prototype - just discovered it yesterday, and I must say it feels like I have come home. It seems to be at just the right level, and it just works (so far). I'm a happy camper! One minor thing - I tried using an Ajax.Updater, and when it completes I want to set the focus to an entry field, but it isn't working. Here's my Ajax.Updater: new Ajax.Updater('row'+code, 'svc/ajax.php', { parameters: {action: 'editlibcat', code: catcode}, onComplete: function() {$('editdescription').focus();} }); This call sets a row in a table into editable form, and there's another Updater that does the update - pretty standard stuff I'd reckon. There definitely IS an element with ID='editdescription' - it's in the HTML that is returned from the Ajax call. But focus never gets set. Everything else is perfect. It must be me - what do I have wrong? Thanks again for Prototype - it's great! --~--~-~--~~~---~--~~ 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: Event.pointerX() Different Between IE and FF?
Not sure about the major browsers but just read about iPhone optimiation of pages and viewport is certainly odd in mobile Safari. Sent from my phone so pardon the spelling errors. On Sep 24, 2009, at 6:34 AM, KammylandSoftware kammyl...@gmail.com wrote: Does it perhaps have anything to do with whether the measurements are taken relative to the Page or Viewport? I'm not quite clear on the difference between the Page and Viewport. Does anyone know if there is a difference? Thanks. --~--~-~--~~~---~--~~ 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: Dynamic test after ajax call
Sounds like your situation is very out of the norm. Usually being able to manipulate the DOM via JS is sufficient except in debugging situations (in which case an extension is fine). Good luck figuring out something different to do. On Mon, Sep 21, 2009 at 9:57 AM, Kumar kumar.k.re...@gmail.com wrote: Thanks Bill. I am already using IE Developer Toolbar with Internet Explorer. I dont want to just see the DOM source, but indeed want to use. It was part of design to use it. Thanks for your reponse though. Thanks On Sep 21, 11:38 am, bill will...@techservsys.com wrote: Kumar wrote: Hi Walter - I completely understood what you meant. I have a strange situation here. My enitre design sits on top of the DOM for lateral processing. As soon as the DOM gets updated, there will be sequence of java script calls based on the elements generated on this DOM for form processing. After I heard that I cannot get the DOM state at the source code level, I will probably take a look at other design issue. This is something I never expected... You can look at the dom source code as it exists at any point in time, just not by clicking view source. As was pointed out below, Firefox + Firebug gives you a elegantly laid out picture (in source) of the dom. Thanks On Sep 21, 9:48 am, Walter Lee Davis wa...@wdstudio.com wrote: There's a fundamental difference between the source code and the current state of the DOM. The former is fixed at the time that your server sends it. And once that source is sent to the browser, the browser interprets it and generates the DOM, which it uses to create the on-screen display of the **current** state of the DOM. Anything you do later to modify the DOM causes the DOM itself to change, and thus the screen to update, but does not update the source you see in your browser. Think of the source as the score, and the DOM as the orchestral performance. The conductor and orchestra is JavaScript, then, to stretch the metaphor. When you request an element by its ID, you are asking the DOM, not the source. When you modify an element on screen, or update it to contain entirely new content, you are modifying the DOM, not the page source. HTML: div id=foosomething here/div JavaScript: $('foo').addClassName('bar'); console.log($('foo').hasClassName('bar')) //= true $$('.bar').invoke('insert',' with classname bar'); console.log($('foo').innerHTML) //= something here with classname bar At no point above, if you looked in the source, would you see that #foo now was #foo.bar, or that its content had changed, unless you were using a tool such as Firebug to inspect the current state of the DOM. Walter On Sep 21, 2009, at 9:22 AM, Kumar wrote: Hi Tj - Thanks for the prompt response. It really amazed me, when I heard that I can see source code of the original document and not the later things that got updated through the Ajax updater. We have this dependency where we need to make series of Java script calls based on the dynamic response created by the Ajax updater. That includes the dynamically generated element id's and stuff. If these are not going to be visible in generated source, how am I supposed to make advantage. Is there a way, though prorotype Ajax ? Thanks On Sep 19, 8:21 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, View source will only show you the original source of the document, not any later modifications you make to the DOM (e.g., via Ajax.Updater or any of several other means). Why does it matter? What is it you're trying to achieve looking at the source? If it's just that you're trying to debug the markup or something, you can use Firefox with the Firebug[1] add-on, which will show you the current DOM tree rather than the original source. [1]http://getfirebug.com/ HTH, -- T.J. Crowder tj / crowder software / comwww.crowdersoftware.com On Sep 18, 11:27 pm,Kumarkumar.k.re...@gmail.com wrote: Hi All - I am using prototype Ajax updater. The main intenntion of using updater is to show users a loading icon, but in background we are making a series webservice calls to wide variety of systems, then collabarate all the data to users at one go. The page loads and calls ajax updater. Updater inturn updates a div tag with a search results. (results are processed in another jsp page). Here is the problem. After the entire page gets loaded with results, when I see the source I do not see the results grid in the source page. I know its just the code that got loaded while making ajax calls. How can I induce the code in to the same source file after the ajax call. Did any one face this issue before. if you have any thoughts, please share it across. Please shoot me an email, if you are still not
[Proto-Scripty] Re: newbie - form submit
Never rely on client side validation, that's for convenience for your users, not security.First, make the functionality works (including security) without javascript. Then override the submit button with javascript by observing the submit. In that event code you submit the form via ajax, hide the div, display what you want, etc. then use event.stop to keep the default submit behavior from occurring. Good luck with this. Some links: http://api.prototypejs.org/dom/event.html#stop-class_method http://api.prototypejs.org/dom/event.html#stop-class_method http://api.prototypejs.org/dom/document.html#observe-class_method http://api.prototypejs.org/dom/element.html#update-class_methodand http://api.prototypejs.org/ajax/ajax/updater.html On Sun, Sep 20, 2009 at 9:47 AM, MEM tal...@gmail.com wrote: Hello all, I'd love to create a contact form using prototype and php. However, I want to make sure that, if the javascript is disable, the submission should be server side validated and submitted as well. If javascript is enable, the onclick event will trigger, hence, the js validation Will occur. If the javascript isn't enable, the onclick event will not trigger, so the submit button will get called, and the server side validation will occur. I don't know if it's precise, however, it works. Now what I'd like to do is, without leaving the same page, when the form is submitted, the div that contains the form gets hidden, and it should be replaced by a div telling: The contact was send. I'm so newbie, that I've found a validation class called: Really easy field validation with Prototype and it seems to be very nice. Can anyone summarize the steps to accomplish this without losing the server side submission if, js Is disable somehow? Should I try to edit (I really don't like this idea) the validation class for doing this? Or can this be done otherwise? Thanks a lot to any feedback on this, Regards, MEM --~--~-~--~~~---~--~~ 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: YSlow's rule JavaScript at the bottom w/Prototype
They do but you'd need to cache each combination of scripts once each. That's a great way to go about it if you require the same scripts on each page, or the landing page requires all of them (and then it'd cache the concat'd and minified version) and you include the lot on each other page no matter if that page needs all or just some of the scripts. On Wed, Sep 16, 2009 at 11:57 AM, Alex McAuley webmas...@thecarmarketplace.com wrote: The compressed versions i speak of do get cached Alex Mcauley http://www.thevacancymarket.com - Original Message - From: skaiuoquer skaiuoq...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, September 16, 2009 7:51 PM Subject: [Proto-Scripty] Re: YSlow's rule JavaScript at the bottom w/Prototype Hey, you and me both, brother. We are building the new framework, starting from scratch, so maybe you are right and I am just troubled by the ghosts of the past and this will not happen this time around when we'll be using sane logic to build our code. I hope you are right. *suspense* On Sep 16, 3:43 pm, Jim Higson j...@wikizzle.org wrote: On Wednesday 16 September 2009 14:43:32 skaiuoquer wrote: A non-cached medium page on it takes above half a minute to load on T1... That's half a minute where the user is pretty much waiting for the JS files to download one after the other. Concatenate all files into one in the order that you are loading them, use yui compressor, gzip. You'll see at least an 80% decrease in load time. Still, I'd question the sanity of any system that takes 30 seconds to serve a web page. Jim --~--~-~--~~~---~--~~ 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: how merge two json objects?
It's explained in the link I gave. On Fri, Sep 11, 2009 at 5:30 PM, Miguel Beltran R. yourpa...@gmail.comwrote: 2009/9/11 DJ Mangus d.man...@gmail.com I've never done this but I'm pretty sure you can use object.extend. http://api.prototypejs.org/language/object.html#extend-class_method but how used? --~--~-~--~~~---~--~~ 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: execution order in IE
See this article: http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically On Thu, Sep 3, 2009 at 9:25 AM, JoJo tokyot...@gmail.com wrote: Instead of loading JS in the head, how do I do includes like virtually all other languages? Isn't Scriptaculous loading Effects.js and other files? How is it doing that? On Sep 2, 11:36 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: If you need to garuntee that a variable,function or method exists i would always wait until the dom is ready or in each function that gets called test the function,variable or method exists else timeout untill it does Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: JoJo tokyot...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, September 03, 2009 6:31 AM Subject: [Proto-Scripty] execution order in IE In my head, I'm loading several JS files. I'm expecting this to occur: 1) script1.js is loaded 2) script1.js runs - it creates an object 3) script2.js is loaded 4) script2.js runs - it creates a different object that depends on script1's object. 5) and so on This works perfectly in Firefox and Safari, but fails about 25% of the time in IE. I've heard that IE will load JS files in the correct order, but will not guarantee that they are executed in the same order. How can I restructure my code or use Prototype to fix my current code? --~--~-~--~~~---~--~~ 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: Ajax.updater - after text has been inserted into element
I don't think there is one that fires afterward. If you function#defer a function onsuccess it should have been completed after the defer timeout. On Wed, Sep 2, 2009 at 3:11 PM, Mojito tokyot...@gmail.com wrote: I'm using the Ajax.Updater. I'm looking for the callback that is executed after the server response text has been inserted into an element. The server is inserting some form elements and I want to apply Scriptaculous's inPlaceEditor to them. Which callback would this be? --~--~-~--~~~---~--~~ 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: Nested, Sortable lists
Methinks some code would help us figure out what you are doing and if we can help. On Mon, Aug 31, 2009 at 6:08 AM, Mike mikemcl...@gmail.com wrote: Hello community, I'm new here, and any help anyone can provide will be greatly appreciated. I am trying to build a set of nested lists, each set of which will be sortable. I don't want to drag items between lists, only allow each list to be reordered. I am getting no errors in my code, but the rendering result is strange. In some cases, no lists will reorder, in others only the first item in the list can be moved, and others work like normal. I haven't been able to identify a pattern. My guess is that the problem is being caused by the sequence in which the sortables are created. I tried inverting the sequence (child lists created first) but that doesn't seem to help. Does anybody have any suggestions? Thanks! Mike --~--~-~--~~~---~--~~ 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: $H need help
gah, just looked at the source, I was wrong about that, ignore the last message I sent. On Tue, Aug 25, 2009 at 4:41 PM, DJ Mangus d.man...@gmail.com wrote: if you feed set() an object it should set multiple key/value pairs at once. On Tue, Aug 25, 2009 at 4:32 PM, Kevin Porter k...@9ballpool.co.uk wrote: What do you mean by 'some pairs'? Looks like set() is what you want. What do you want your hash to look like before and after? - Kev buda wrote: Sorry for not full description of my task - I need to add some pairs to a hash - so set() doesnt hepl me :( On 26 авг, 01:18, Kevin Porter k...@9ballpool.co.uk wrote: Oops sorry! Posted without testing, I didn't realise you lost that assignment notation with a $H() hash. - Kev DJ Mangus wrote: what you want to do is h.set(input.id http://input.id, input.getValue()) Seehttp://www.prototypejs.org/api/hash/set 2009/8/25 Kevin Porter k...@9ballpool.co.uk mailto: k...@9ballpool.co.uk Same: var h = $H({}); h[input.id http://input.id] = input.getValue(); - Kev buda wrote: Thanks for replay, but I Do need to add it to a $H object how to do it? Thanks ) On 26 авг, 00:14, Kevin Porter k...@9ballpool.co.uk mailto:k...@9ballpool.co.uk wrote: var h = {}; h[input.id http://input.id] = input.getValue(); Doesn't even need to be a $H(), just a regular JS object/hash. - Kev buda wrote: I need to add to a hash id of an input and its value when I try to do var h = $H({}); h.update({ input.id http://input.id: input.getValue() }); an error of bad syntax is generated how can I add an element to a hash which key is an input.id http://input.id and value is an input.getValue()? Thanks -- Kevin Porter Advanced Web Construction Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp:// 9ballpool.co.uk http://9ballpool.co.uk AJAX Blackjack - real-time multi-player blackjack game with no flash, java or software downloads required -http://blackjack.webutils.co.uk-Скрытьhttp://blackjack.webutils.co.xn--uk--eed4aej5ekцитируемый текст - - Показать цитируемый текст - -- Kevin Porter Advanced Web Construction Ltd http://webutils.co.uk http://billiardsearch.net http://9ballpool.co.uk AJAX Blackjack - real-time multi-player blackjack game with no flash, java or software downloads required - http://blackjack.webutils.co.uk -- Kevin Porter Advanced Web Construction Ltdhttp://webutils.co.ukhttp://billiardsearch.nethttp://9ballpool.co.uk AJAX Blackjack - real-time multi-player blackjack game with no flash, java or software downloads required -http://blackjack.webutils.co.uk-Скрыть цитируемый текст - - Показать цитируемый текст - -- Kevin Porter Advanced Web Construction Ltd http://webutils.co.uk http://billiardsearch.net http://9ballpool.co.uk AJAX Blackjack - real-time multi-player blackjack game with no flash, java or software downloads required - http://blackjack.webutils.co.uk --~--~-~--~~~---~--~~ 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: scope of this in anonymous functions
Everything in js is an object. Even function literals. On 8/22/09, JoJo tokyot...@gmail.com wrote: How do I use bind? Doesn't the bind function take an object as an argument? I'm doing this stuff inside a class, not an object. On Aug 22, 6:15 pm, Gareth Evans agr...@gmail.com wrote: Use bind (method on the function object) see the typewriter example i wrote for syntax On Sun, Aug 23, 2009 at 9:06 AM, Mojito tokyot...@gmail.com wrote: MyClass = Class.create({ initialize: function() { this.myField = null; Event.observe(window, 'load', function() { this.myField = new Field(); }); }, myMethod: function() { alert(this.myField); } }); +++ Field's constructor uses Scriptaculous's sliders, which require an element to be already loaded. That's why I'm only setting this.myField when the window has loaded. I see that my sliders get initialized properly, but this.myField is still null when I call myMethod(). I suspect this has something to do with the this scope in my anonymous function. How do I fix this to do what I intended? -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Automatically Converting HTML to DOM (e.g. new Element ...)
Yes if your roundtrip is slow then doing it clientside can make it seem more responsive. There is the issue though of what happens if the server save fails? Revert your changes? Overall using serverside output is less troublesome, easier to code, and more robust. On 8/20/09, drewB dbats...@gmail.com wrote: Unlikely. There is very little difference in computation effort between generating JSON, XML, HTML or delimited text at the server. I will have to take your word for this. I assumed it to be different. So why put it in two places? Why turn data into say JSON just so you can later turn it into HTML? Just create HTML in the first place using a template on the server. It would only really only be in one place - client side scripting. The JSON would be a single line. The greatest time taken is in getting the data from the server, which will be (pretty much) the same regardless of how the data is formatted. If it takes place client-side, the client doesn't need to wait for data to come back from the server before the new items are displayed. They are displayed right away while data is sent back to the server to be saved. -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Observing a checkbox
Spec and reality often differ. On 8/18/09, ColinFine colin.f...@pace.com wrote: On Aug 13, 2:53 pm, Jeztah webmas...@thecarmarketplace.com wrote: What is the correct Cross browser way to observe a checkbox being checked or not I am using $('hidenonlive').observe('change',function() { if($('hidenonlive').checked!==true) { alert('Showing'); } else { $$('.dead-vacancy').invoke('hide'); } }); But it doesnt seem to want to work in IE8 and it doesnt throw an error SHoudl i just use click instead? You are tabbing to a different field after clicking, yes? The definition of 'onChange' in the HTML spec (http://www.w3.org/TR/ html401/interact/scripts.html#adef-onchange) is The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Automatically Converting HTML to DOM (e.g. new Element ...)
I can't help with the solution but since you need serverside processing anyway why not just do it all serverside? On 8/18/09, drewB dbats...@gmail.com wrote: Yes, by javascript I mean Prototype API. A simplified use case is as follows: A user has selected X pieces of furniture. On a single page, they are shown a list of the furniture items with specific info about each piece. For example, name, dimensions, manufacture, list of parts etc. Much of this info wouldn't be shown by default but is expandable. The user can delete furniture items or add new ones. When they add a new one it is immediately added to the page. In order to add it to the page (without reloading the whole page), I either need to dynamically build the new furniture item block using javascript or use AJAX, build the block server-side and then add it to the page. At first glance, doing it server side might seem easier but I am playing with moving as much of the presentation code client-side as possible. So, the server-side job would just be to build a js array with name, dimensions, manufacture, list of parts, etc for each piece of furniture and use javascript to build the whole page. I hope that is clear. On Aug 18, 8:40 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I don't think I'm clear on what the use case is and why you're converting it from HTML to JavaScript (by which I take it you mean DOM API or Prototype API or Builder code). What's the goal of the conversion? -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 18, 4:28 pm, drewB dbats...@gmail.com wrote: Interesting suggestion. Unfortunately, the content is more dynamic them just text replacements. For example, there is a list of varying length. Also just using template for 200 lines of text doesn't seem very tidy to me. On Aug 18, 3:19 am, Richard Quadling rquadl...@googlemail.com wrote: 2009/8/18 drewB dbats...@gmail.com: I have 200 lines of an HTML snippet that I plan to convert to javascript using Prototypes Elements. Instead of doing this by hand, I figure I could write some code that would take any block of HTML and convert it to javascript. Then it occurs to me that I couldn't be the first one to think of this. Does anyone have some code that will do this or know of a tool? I am looking for something like http://www.smelzo.it/html2js/butusingPrototype Elements instead of basic javascript (something that uses Builder would be ok also). Thanks! Once you've converted it to JS, what do you intend to do with it? If you are going to re-use it (say with different content), then maybe the Template mechanism within Prototype [1] would be what you are looking for. Richard. [1]http://prototypejs.org/api/template -- - Richard Quadling Standing on the shoulders of some very clever giants! EE :http://www.experts-exchange.com/M_248814.html Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA :http://uk.zopa.com/member/RQuadling -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Dropping
Revert true then move it in the dom in your droopable callback. Should work for inline elements. On 8/14/09, Floyd Resler adexfl...@gmail.com wrote: I think you're right on that. I should have expanded my question. If the object isn't dropped on a Droppable object, how do I get it to go back to its original position? I tried setting revert to true but the object always goes back. Thanks! Floyd On Aug 14, 2009, at 5:58 AM, Alex McAuley wrote: I am sure that Droppables do that already dont they ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Floyd Resler adexfl...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, August 13, 2009 9:55 PM Subject: [Proto-Scripty] Dropping I want to make an object revert back to its original position only if it isn't dropped on an object that accepts it. How can I do this? Thanks! Floyd -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: how to select multiple entries from a auto complete box?
If you use the script.aculo.us autocompleter the option you need to set is called tokens which takes either a string or an array of strings to reset on. Note: I haven't used autocompleter myself just looked up the info. On Mon, Aug 10, 2009 at 4:11 AM, Angelinemailangel...@gmail.com wrote: Hi, I have an auto complete box which is populated with the list of users of the application. It is working fine with the box listing the users. But I am able to select only one user. How to select multiple users from the list ? I am using the built-in auto complete feature of the CakePHP framework. But in order to select multiple entries, I think I must code the js separately, since the ajax helper in CakePHP does not support selecting multiple entries. This is the action in the controller which generates the auto complete text box. function autoComplete() { $this-set('users',$this-User-find('all',array( 'fields'=array ('User.id','User.name'), 'conditions'=array('User.name LIKE' = $this-data['User'] ['name'].'%'; $this-layout = ajax; } This is the auto_complete.ctp file ul ?php foreach($users as $user): ? li?php echo $user['User']['name']; ?/li ?php endforeach; ? /ul And this is the view where I have the auto complete box: ?php echo $form-create('User', array('url' = '/forms/share')); ? ?php echo $ajax-autoComplete('User.name', '/forms/ autoComplete');? ?php echo $form-end('Share');? In the auto complete box, I am able to select only one user name. how can I select multiple users with a comma or space separator? --~--~-~--~~~---~--~~ 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: Making a Draggable-pool
Not sure I understand what you are wanting to do. If you mean drag from one location and the pop back so it can be dragged again, then yes you have full control over what happens during and after drags. Look in the documentation for the various callbacks you have available. On 8/10/09, Drr cran...@web.de wrote: Hi, is it possible to make a draggable be dragged unlimited times from one Position? I want to make some kind of Item pool that can be dragged multiple times... -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: spam click = buggy???
I can't get to the examples on my phone to check but do the examples use the event queue? If not that explains it, these effects run simultaneously and can get tangled unless you use the queue. You should be able to look event queues up for more info. Note: not all effects tangle which is why you have to specify when you want to queue things. On 8/8/09, HOLYCOWBATMAN junkdema...@gmail.com wrote: Hi , im looking into script.aculo.us Functional Tests effects3_test and if i spam 'Start slide down' 4-5 times( or any other effect on any other page) it starts to bug... the animation is only partial then complete instantly and it wont get back to normal until i reload the page. I would like to know if this is normal... and if its the example that are faulty .. or scriptaculous itself ( i tested it in ie8 and ff3 and the same bug happens ) or if its something on my side Im just starting to look into some javascript / ajax framework and found scriptaculous / prototype to be really simple and powerfull but seeing that kind of bug would make me stay away from the 'effects'...everything else seems great though! -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Example values input text
I don't know of a plugin like that but shouldn't be too hard to port On 8/7/09, spielberg inmo...@gmail.com wrote: Hello to the people of the group. It´s my first question. Any one know abut something like this http://mucur.name/system/jquery_example/ to prototype?? I need to use the element title of the text input. Thanks for all; Spielberg -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Updating a form's clean state
You could implement your own reset method on your form object. On 8/7/09, mr_justin gro...@jperkins.otherinbox.com wrote: This is in no way a prototype related question, but we've got some pretty smart JavasScript people on here so I figured I'd pose the question. Here's the scenario: I have a form on a page with a bunch of inputs (text boxes). That form is hidden by default. Elsewhere on the page is a list of elements that are hooked up to an IPE. The elements that can be edited by the IPE are the same as those that can be edited in the form. So yes, there are two ways to edit the same data. One place is inline while you're reading it, and the other is if you click a little edit link that flips the page into edit mode. Does that make sense so far? Once in edit mode, you can either save your changes or click cancel which calls the built-in Form#reset() method that resets the form to it's clean state (the state the form was in when the page loaded). Now here's the thing, if you use the IPE to edit the data inline, the data is saved to the server AND also the corresponding input control in the hidden form is updated. That puts the form in a dirty state. So if I call the reset method at this point, the changes I just made with the IPE are cleared out. Those changes have already been saved to the server, so it doesn't make sense to clear them. Now that I've explained it all, my question is, does anyone know of a way to update a form's clean state somehow without a DOM reload? Perhaps there's a method that can be called on a form object? Maybe instead of just updating the value of the input I should replace the entire input. Hmmm, that's not a bad idea. What do you guys think? -justin -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: lightwindow not working after ajax update
From glancing at the source of that it doesn't look like it handles elements created after the lightwindow object is initialized. You might want to get ahold of the author of that for support with it. 2009/8/7 Martín Marqués martin.marq...@gmail.com: lightwindow is based on scriptaculous. http://www.stickmanlabs.com/lightwindow/ Nobody uses it? 2009/8/6 DJ Mangus d.man...@gmail.com: Explain lightwindow for me, does it use javascript to display? If so then post that script too please. On 8/6/09, Martín Marqués martin.marq...@gmail.com wrote: We are working on and html page which has a div with id=container that gets updated when pressing link buttons that are on the top. This is very simple code: new Ajax.Updater('container', 'somepage.html', { parameters: { method: GET } }); The thing is that one of the pages has a link with lightwindow class. This page by it self works great, but when it is inserted in the container div it doesn't use the lightwindow efect, it just opens the link as if it was a normal link youn press on. Anything wrong with how we are working with this? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- Sent from my mobile device -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador --~--~-~--~~~---~--~~ 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: Updating a form's clean state
Of course. Shouldn't be really hard to implement your own reset though. Just keep a hash of initial values and ids (you can use http://www.prototypejs.org/api/element/identify to give elements w/o an id one) and upon customreset set them all back. Then if you save changes to server just update the hash. On Fri, Aug 7, 2009 at 1:53 PM, mr_justingro...@jperkins.otherinbox.com wrote: Yeah that would require quite a bit more work than I was thinking. I tried out the technique of replacing the entire input control rather than just updating the value, and it works great. Except in IE. Of course. -justin --~--~-~--~~~---~--~~ 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: How to loop through array? New to Proto
Give them all a class of 'error' and use $$('error').each('hide') Note: drycoded on my phone so look those up before using them. On 8/7/09, trope jtrope...@gmail.com wrote: I have some code that appears to be a prime candidate for a loop. How could I wrap this up in one neat little function??? /* Hide previous errors */ $('ErrorConsumerEmail0address').hide(); $('ErrorConsumerfirstname').hide(); $('ErrorConsumerlastname').hide(); $('ErrorConsumerPhone0Number').hide(); Thank you. Trope! -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: lightwindow not working after ajax update
Explain lightwindow for me, does it use javascript to display? If so then post that script too please. On 8/6/09, Martín Marqués martin.marq...@gmail.com wrote: We are working on and html page which has a div with id=container that gets updated when pressing link buttons that are on the top. This is very simple code: new Ajax.Updater('container', 'somepage.html', { parameters: { method: GET } }); The thing is that one of the pages has a link with lightwindow class. This page by it self works great, but when it is inserted in the container div it doesn't use the lightwindow efect, it just opens the link as if it was a normal link youn press on. Anything wrong with how we are working with this? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
Try adding e.preventDefault(); instead of Event.stop(e) and let me know if that works? On Tue, Aug 4, 2009 at 4:55 PM, Ashashley.kenner...@gmail.com wrote: function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } --~--~-~--~~~---~--~~ 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: Browser scroller position after Ajax.Update
Maybe this might help. http://www.prototypejs.org/api/element/scrollto On Wed, Aug 5, 2009 at 1:33 PM, DJJQjoll...@hotmail.com wrote: Oh my god my english was terrible in my post, sorry about that. I'll try to explain the problem again: On my php page I have a link a long way down the page, so users have to scroll down a bit. the link triggers an ajax.update on the page. When users press the link the browser returns to the top of the page. How do I restore the browser position to where the link is? (So the scroller position remains unchanged when calling ajax update) On Aug 5, 9:45 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Can you explain it a bit better please... i cant really understand what you mean by that Thanks Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 8:22 PM Subject: [Proto-Scripty] Browser scroller position after Ajax.Update Hello. My problem when is apparent on my page. The div to be updated (and link) are a long way down the page so users have to scroll down. When they press the link and thus update the div the browsers scroller returns to top, forcing the user to scroll down again to the div. Is there any quickfix (like option I have missed) or more advanced solution? Best Regards and Thanks in Advance, Joel --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
Are you getting any Javascript errors? Note: firefox and firebug is your friend. Don't forget to break on all errors. On Wed, Aug 5, 2009 at 11:22 AM, Ashashley.kenner...@gmail.com wrote: Hi, I wasn't sure whether you meant in the 1st or second function, but it doesn't make a difference in either. I think it is the Event.observe('password-form', 'submit', callProcBasketPassword); which is not working properly, although I don't know how to debug it On Aug 5, 6:48 pm, DJ Mangus d.man...@gmail.com wrote: Try adding e.preventDefault(); instead of Event.stop(e) and let me know if that works? On Tue, Aug 4, 2009 at 4:55 PM, Ashashley.kenner...@gmail.com wrote: function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
nods when Firebug breaks on the error, check the DOM tab to see the state at that particular moment. On Wed, Aug 5, 2009 at 2:05 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Seems the element does not exist... Does it exist in the DOM ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:04 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX When I set firebug to break on all errors... Submit the first form and I get (from prototype.js) function getEventID(element) { element is null3936 if (element._prototypeEventID) return element._prototypeEventID[0]; (element is null error) if I step past it and submit the second form I get the same error again Unfortunately I don't know why both errors are caused, can you help please? On Aug 5, 9:40 pm, DJ Mangus d.man...@gmail.com wrote: Are you getting any Javascript errors? Note: firefox and firebug is your friend. Don't forget to break on all errors. On Wed, Aug 5, 2009 at 11:22 AM, Ashashley.kenner...@gmail.com wrote: Hi, I wasn't sure whether you meant in the 1st or second function, but it doesn't make a difference in either. I think it is the Event.observe('password-form', 'submit', callProcBasketPassword); which is not working properly, although I don't know how to debug it On Aug 5, 6:48 pm, DJ Mangus d.man...@gmail.com wrote: Try adding e.preventDefault(); instead of Event.stop(e) and let me know if that works? On Tue, Aug 4, 2009 at 4:55 PM, Ashashley.kenner...@gmail.com wrote: function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
actually just checked firebug, best place would be html tab. DOM tab lists the entire DOM which would be very hard to go through. On Wed, Aug 5, 2009 at 2:12 PM, Ashashley.kenner...@gmail.com wrote: Sorry, i'm quite new to this, should I be looking for the form id=password-form element in the DOM, not sure where to look for it in the DOM tab of firebug? Is this correct? On Aug 5, 10:06 pm, DJ Mangus d.man...@gmail.com wrote: nods when Firebug breaks on the error, check the DOM tab to see the state at that particular moment. On Wed, Aug 5, 2009 at 2:05 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Seems the element does not exist... Does it exist in the DOM ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:04 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX When I set firebug to break on all errors... Submit the first form and I get (from prototype.js) function getEventID(element) { element is null3936 if (element._prototypeEventID) return element._prototypeEventID[0]; (element is null error) if I step past it and submit the second form I get the same error again Unfortunately I don't know why both errors are caused, can you help please? On Aug 5, 9:40 pm, DJ Mangus d.man...@gmail.com wrote: Are you getting any Javascript errors? Note: firefox and firebug is your friend. Don't forget to break on all errors. On Wed, Aug 5, 2009 at 11:22 AM, Ashashley.kenner...@gmail.com wrote: Hi, I wasn't sure whether you meant in the 1st or second function, but it doesn't make a difference in either. I think it is the Event.observe('password-form', 'submit', callProcBasketPassword); which is not working properly, although I don't know how to debug it On Aug 5, 6:48 pm, DJ Mangus d.man...@gmail.com wrote: Try adding e.preventDefault(); instead of Event.stop(e) and let me know if that works? On Tue, Aug 4, 2009 at 4:55 PM, Ashashley.kenner...@gmail.com wrote: function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
good question. You might change Event.observe( . . . etc to Event.observe.defer( . . . and see if that fixes it. Odd that the node isn't available in the DOM at onSuccess but that might work around it while I research. On Wed, Aug 5, 2009 at 2:22 PM, Ashashley.kenner...@gmail.com wrote: yes, when I check the HTML tab, the form with the id=password-form has not been created within the email-response div, even though I have waited to check for it with the onSuccess line EG function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } Once I jump past the error, the email-response div gets populated with the form i'm trying to observe, so the question is, why is the onSuccess running before the DOM has been updated? On Aug 5, 10:17 pm, DJ Mangus d.man...@gmail.com wrote: actually just checked firebug, best place would be html tab. DOM tab lists the entire DOM which would be very hard to go through. On Wed, Aug 5, 2009 at 2:12 PM, Ashashley.kenner...@gmail.com wrote: Sorry, i'm quite new to this, should I be looking for the form id=password-form element in the DOM, not sure where to look for it in the DOM tab of firebug? Is this correct? On Aug 5, 10:06 pm, DJ Mangus d.man...@gmail.com wrote: nods when Firebug breaks on the error, check the DOM tab to see the state at that particular moment. On Wed, Aug 5, 2009 at 2:05 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Seems the element does not exist... Does it exist in the DOM ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:04 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX When I set firebug to break on all errors... Submit the first form and I get (from prototype.js) function getEventID(element) { element is null3936 if (element._prototypeEventID) return element._prototypeEventID[0]; (element is null error) if I step past it and submit the second form I get the same error again Unfortunately I don't know why both errors are caused, can you help please? On Aug 5, 9:40 pm, DJ Mangus d.man...@gmail.com wrote: Are you getting any Javascript errors? Note: firefox and firebug is your friend. Don't forget to break on all errors. On Wed, Aug 5, 2009 at 11:22 AM, Ashashley.kenner...@gmail.com wrote: Hi, I wasn't sure whether you meant in the 1st or second function, but it doesn't make a difference in either. I think it is the Event.observe('password-form', 'submit', callProcBasketPassword); which is not working properly, although I don't know how to debug it On Aug 5, 6:48 pm, DJ Mangus d.man...@gmail.com wrote: Try adding e.preventDefault(); instead of Event.stop(e) and let me know if that works? On Tue, Aug 4, 2009 at 4:55 PM, Ashashley.kenner...@gmail.com wrote: function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } --~--~-~--~~~---~--~~ 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: Browser scroller position after Ajax.Update
The only problem with that solution is you provide no degradation to people without javascript. On 8/5/09, DJJQ joll...@hotmail.com wrote: Thank you for your solution, but instead I changed a href=# to a href=javascript:null() and it works like a charm. On Aug 5, 11:00 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Nope... If you are observing the click with observe() just call Event.stop(event); on it Example. $('myHref').observe('click',function(event) { Event.stop(event); Your ajax code here. }); That way it will degrade in browsers not having javascript and they will just goto the href of the link. HTH Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 9:42 PM Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update Yes that's right. Maybe that's the problem, should I javascript:null it? On Aug 5, 10:40 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: what does the link look like ? a href=# Click me/a Like that ? Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 9:33 PM Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update Oh my god my english was terrible in my post, sorry about that. I'll try to explain the problem again: On my php page I have a link a long way down the page, so users have to scroll down a bit. the link triggers an ajax.update on the page. When users press the link the browser returns to the top of the page. How do I restore the browser position to where the link is? (So the scroller position remains unchanged when calling ajax update) On Aug 5, 9:45 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Can you explain it a bit better please... i cant really understand what you mean by that Thanks Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 8:22 PM Subject: [Proto-Scripty] Browser scroller position after Ajax.Update Hello. My problem when is apparent on my page. The div to be updated (and link) are a long way down the page so users have to scroll down. When they press the link and thus update the div the browsers scroller returns to top, forcing the user to scroll down again to the div. Is there any quickfix (like option I have missed) or more advanced solution? Best Regards and Thanks in Advance, Joel -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
yes but onSuccess shouldn't be called until after the ajax.updater is completed. Therefore the DOM node should be available at that point. On Wed, Aug 5, 2009 at 2:40 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Ajax is Asyncronous so it gets executed along with other script ... ergo its not serial like php and other stuff your prolly used to... you can make a request synconous (script waits for the ajax request to finish before continuing but its not recommended Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:37 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX That seems to be working! Is Event.observe.defer a standard method, or is it only to be used in certain cases? I'm happy that it's working but I would really like to learn the basics properly. Thanks anyway for getting me up and running! Ashley On Aug 5, 10:32 pm, DJ Mangus d.man...@gmail.com wrote: good question. You might change Event.observe( . . . etc to Event.observe.defer( . . . and see if that fixes it. Odd that the node isn't available in the DOM at onSuccess but that might work around it while I research. On Wed, Aug 5, 2009 at 2:22 PM, Ashashley.kenner...@gmail.com wrote: yes, when I check the HTML tab, the form with the id=password-form has not been created within the email-response div, even though I have waited to check for it with the onSuccess line EG function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } Once I jump past the error, the email-response div gets populated with the form i'm trying to observe, so the question is, why is the onSuccess running before the DOM has been updated? On Aug 5, 10:17 pm, DJ Mangus d.man...@gmail.com wrote: actually just checked firebug, best place would be html tab. DOM tab lists the entire DOM which would be very hard to go through. On Wed, Aug 5, 2009 at 2:12 PM, Ashashley.kenner...@gmail.com wrote: Sorry, i'm quite new to this, should I be looking for the form id=password-form element in the DOM, not sure where to look for it in the DOM tab of firebug? Is this correct? On Aug 5, 10:06 pm, DJ Mangus d.man...@gmail.com wrote: nods when Firebug breaks on the error, check the DOM tab to see the state at that particular moment. On Wed, Aug 5, 2009 at 2:05 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Seems the element does not exist... Does it exist in the DOM ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:04 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX When I set firebug to break on all errors... Submit the first form and I get (from prototype.js) function getEventID(element) { element is null3936 if (element._prototypeEventID) return element._prototypeEventID[0]; (element is null error) if I step past it and submit the second form I get the same error again Unfortunately I don't know why both errors are caused, can you help please? On Aug 5, 9:40 pm, DJ Mangus d.man...@gmail.com wrote: Are you getting any Javascript errors? Note: firefox and firebug is your friend. Don't forget to break on all errors. On Wed, Aug 5, 2009 at 11:22 AM, Ashashley.kenner...@gmail.com wrote: Hi, I wasn't sure whether you meant in the 1st or second function, but it doesn't make a difference in either. I think it is the Event.observe('password-form', 'submit', callProcBasketPassword); which is not working properly, although I don't know how to debug it On Aug 5, 6:48 pm, DJ Mangus d.man...@gmail.com wrote: Try adding e.preventDefault(); instead of Event.stop(e) and let me know if that works? On Tue, Aug 4, 2009 at 4:55 PM, Ashashley.kenner...@gmail.com wrote: function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } --~--~-~--~~~---~--~~ You received this message because
[Proto-Scripty] Re: Browser scroller position after Ajax.Update
pretty much yes but some shut it off for security reasons On Wed, Aug 5, 2009 at 3:01 PM, DJJQjoll...@hotmail.com wrote: Ok. I thought everyone had javscript by now :) On Aug 5, 11:39 pm, DJ Mangus d.man...@gmail.com wrote: The only problem with that solution is you provide no degradation to people without javascript. On 8/5/09, DJJQ joll...@hotmail.com wrote: Thank you for your solution, but instead I changed a href=# to a href=javascript:null() and it works like a charm. On Aug 5, 11:00 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Nope... If you are observing the click with observe() just call Event.stop(event); on it Example. $('myHref').observe('click',function(event) { Event.stop(event); Your ajax code here. }); That way it will degrade in browsers not having javascript and they will just goto the href of the link. HTH Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 9:42 PM Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update Yes that's right. Maybe that's the problem, should I javascript:null it? On Aug 5, 10:40 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: what does the link look like ? a href=# Click me/a Like that ? Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 9:33 PM Subject: [Proto-Scripty] Re: Browser scroller position after Ajax.Update Oh my god my english was terrible in my post, sorry about that. I'll try to explain the problem again: On my php page I have a link a long way down the page, so users have to scroll down a bit. the link triggers an ajax.update on the page. When users press the link the browser returns to the top of the page. How do I restore the browser position to where the link is? (So the scroller position remains unchanged when calling ajax update) On Aug 5, 9:45 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: Can you explain it a bit better please... i cant really understand what you mean by that Thanks Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: DJJQ joll...@hotmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 8:22 PM Subject: [Proto-Scripty] Browser scroller position after Ajax.Update Hello. My problem when is apparent on my page. The div to be updated (and link) are a long way down the page so users have to scroll down. When they press the link and thus update the div the browsers scroller returns to top, forcing the user to scroll down again to the div. Is there any quickfix (like option I have missed) or more advanced solution? Best Regards and Thanks in Advance, Joel -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Beginners question, trouble with Event.stop in AJAX
OK, just checked the source. onComplete is where ajax.updater actually updates the node. onSuccess is called before that. Workaround is to either a.) use defer like you did, or b.) use Ajax.request and update it yourself onSuccess, then do your Event.observe. Plusses of option b is that it won't try and update anything upon a failed ajax request. On Wed, Aug 5, 2009 at 3:03 PM, Ashashley.kenner...@gmail.com wrote: I wonder why in this case, that onSuccess is executed before the DOM node has been created. Using a hack is okay to get me up and running but I would like to know how to use ajax methods correctly On Aug 5, 10:48 pm, DJ Mangus d.man...@gmail.com wrote: yes but onSuccess shouldn't be called until after the ajax.updater is completed. Therefore the DOM node should be available at that point. On Wed, Aug 5, 2009 at 2:40 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Ajax is Asyncronous so it gets executed along with other script ... ergo its not serial like php and other stuff your prolly used to... you can make a request synconous (script waits for the ajax request to finish before continuing but its not recommended Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:37 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX That seems to be working! Is Event.observe.defer a standard method, or is it only to be used in certain cases? I'm happy that it's working but I would really like to learn the basics properly. Thanks anyway for getting me up and running! Ashley On Aug 5, 10:32 pm, DJ Mangus d.man...@gmail.com wrote: good question. You might change Event.observe( . . . etc to Event.observe.defer( . . . and see if that fixes it. Odd that the node isn't available in the DOM at onSuccess but that might work around it while I research. On Wed, Aug 5, 2009 at 2:22 PM, Ashashley.kenner...@gmail.com wrote: yes, when I check the HTML tab, the form with the id=password-form has not been created within the email-response div, even though I have waited to check for it with the onSuccess line EG function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } Once I jump past the error, the email-response div gets populated with the form i'm trying to observe, so the question is, why is the onSuccess running before the DOM has been updated? On Aug 5, 10:17 pm, DJ Mangus d.man...@gmail.com wrote: actually just checked firebug, best place would be html tab. DOM tab lists the entire DOM which would be very hard to go through. On Wed, Aug 5, 2009 at 2:12 PM, Ashashley.kenner...@gmail.com wrote: Sorry, i'm quite new to this, should I be looking for the form id=password-form element in the DOM, not sure where to look for it in the DOM tab of firebug? Is this correct? On Aug 5, 10:06 pm, DJ Mangus d.man...@gmail.com wrote: nods when Firebug breaks on the error, check the DOM tab to see the state at that particular moment. On Wed, Aug 5, 2009 at 2:05 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Seems the element does not exist... Does it exist in the DOM ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:04 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX When I set firebug to break on all errors... Submit the first form and I get (from prototype.js) function getEventID(element) { element is null3936 if (element._prototypeEventID) return element._prototypeEventID[0]; (element is null error) if I step past it and submit the second form I get the same error again Unfortunately I don't know why both errors are caused, can you help please? On Aug 5, 9:40 pm, DJ Mangus d.man...@gmail.com wrote: Are you getting any Javascript errors? Note: firefox and firebug is your friend. Don't forget to break on all errors. On Wed, Aug 5, 2009 at 11:22 AM, Ashashley.kenner...@gmail.com wrote: Hi, I wasn't sure whether you meant in the 1st or second function, but it doesn't make a difference in either. I think it is the Event.observe('password-form', 'submit', callProcBasketPassword); which is not working
[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX
I honestly think the defer is best at this point as oncomplete occurs even on failed requests. Your choices are to rewrite your own stuff instead of prototype functions (ie. Do your own success checks or do your own updating) or just stick with defer. On 8/5/09, Ash ashley.kenner...@gmail.com wrote: Do you mean to use function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onComplete: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } rather than testing for onSuccess? On Aug 5, 11:07 pm, DJ Mangus d.man...@gmail.com wrote: OK, just checked the source. onComplete is where ajax.updater actually updates the node. onSuccess is called before that. Workaround is to either a.) use defer like you did, or b.) use Ajax.request and update it yourself onSuccess, then do your Event.observe. Plusses of option b is that it won't try and update anything upon a failed ajax request. On Wed, Aug 5, 2009 at 3:03 PM, Ashashley.kenner...@gmail.com wrote: I wonder why in this case, that onSuccess is executed before the DOM node has been created. Using a hack is okay to get me up and running but I would like to know how to use ajax methods correctly On Aug 5, 10:48 pm, DJ Mangus d.man...@gmail.com wrote: yes but onSuccess shouldn't be called until after the ajax.updater is completed. Therefore the DOM node should be available at that point. On Wed, Aug 5, 2009 at 2:40 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Ajax is Asyncronous so it gets executed along with other script ... ergo its not serial like php and other stuff your prolly used to... you can make a request synconous (script waits for the ajax request to finish before continuing but its not recommended Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:37 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX That seems to be working! Is Event.observe.defer a standard method, or is it only to be used in certain cases? I'm happy that it's working but I would really like to learn the basics properly. Thanks anyway for getting me up and running! Ashley On Aug 5, 10:32 pm, DJ Mangus d.man...@gmail.com wrote: good question. You might change Event.observe( . . . etc to Event.observe.defer( . . . and see if that fixes it. Odd that the node isn't available in the DOM at onSuccess but that might work around it while I research. On Wed, Aug 5, 2009 at 2:22 PM, Ashashley.kenner...@gmail.com wrote: yes, when I check the HTML tab, the form with the id=password-form has not been created within the email-response div, even though I have waited to check for it with the onSuccess line EG function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', { method: 'post', parameters: pars, onSuccess: function(response) { Event.observe('password-form', 'submit', callProcBasketPassword); } }); Event.stop(e); } Once I jump past the error, the email-response div gets populated with the form i'm trying to observe, so the question is, why is the onSuccess running before the DOM has been updated? On Aug 5, 10:17 pm, DJ Mangus d.man...@gmail.com wrote: actually just checked firebug, best place would be html tab. DOM tab lists the entire DOM which would be very hard to go through. On Wed, Aug 5, 2009 at 2:12 PM, Ashashley.kenner...@gmail.com wrote: Sorry, i'm quite new to this, should I be looking for the form id=password-form element in the DOM, not sure where to look for it in the DOM tab of firebug? Is this correct? On Aug 5, 10:06 pm, DJ Mangus d.man...@gmail.com wrote: nods when Firebug breaks on the error, check the DOM tab to see the state at that particular moment. On Wed, Aug 5, 2009 at 2:05 PM, Alex McAuleywebmas...@thecarmarketplace.com wrote: Seems the element does not exist... Does it exist in the DOM ? Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ash ashley.kenner...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, August 05, 2009 10:04 PM Subject: [Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX When I set firebug to break
[Proto-Scripty] Re: Beginners question, trouble with Event.stop in AJAX
Is the password-form submit button a return from procBasketEmail.php? if so then you should observe it in the OnSuccess callback. If that isn't correct chalk it up to me checking this moments after awakening. On Mon, Aug 3, 2009 at 6:23 AM, Ashashley.kenner...@gmail.com wrote: Thanks for the help, I just tried replacing Event.stop(e); with return false; in the function but it still submits the form. I would prefer to do it the new way anyway, if you would be able to help me... The first function is called from Event.observe('email-form', 'submit', callProcBasketEmail); which is within a function that is called when the document loads. The question is, where to put the event observe to watch the second form. My first instinct would be to put it in the function which outputs the form EG function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', {method: 'post', parameters: pars}); Event.observe('password-form', 'submit', callProcBasketPassword); Event.stop(e); } (line added just after the ajax function has drawn 'password-form' to the screen) But this stops the whole function from working - where should the observe line be placed to ensure it will work properly? Thanks in advance, I think once I get over these initial few hurdles of getting to grips with good practices, I will be fine! Ashley Here is the javascript in full: // Attach handler to window load event Event.observe(window, 'load', init, false); function init(){ Event.observe('email-form', 'submit', callProcBasketEmail); } function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', {method: 'post', parameters: pars}); Event.observe('password-form', 'submit', callProcBasketPassword); Event.stop(e); } function callProcBasketPassword(e) { var pars = Form.serialize('password-form'); alert(pars); var myAjax = new Ajax.Updater('password-response', 'procBasketPassword.php', {method: 'post', parameters: pars}); Event.stop(e); } On Aug 2, 11:19 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Ashley, In the one that's not working, you're using what's called a DOM0- style handler -- that's where you're attaching the handler the old- fashioned way, by using an attribute on the form element: form id=password-form onsubmit=callProcBasketPassword() action=procBasketPasswordNoJS.php method=post Event.stop works only for handlers registered with more modern methods like the Event.observe you used with your first form. To correct the problem, I'd recommend using Event.observe to set up the handler for the second form as you did with the first. If there's a reason you can't do that, though, the DOM0 equivalent of Event.stop is to return false from callProcBasketPassword. HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 1, 4:35 pm, Ash ashley.kenner...@gmail.com wrote: Hi, I just started my first experiment with AJAX today. Got the basics working, but when I add a tiny bit more complexity I have a problem, Event.stop doesn't work properly for me. I've followed a couple of basic tutorials to submit an e-mail address to a PHP script, the PHP looks up the e-mail address and if it finds it, it shows an input to enter a password. This all works fine except the function with the ajax call to the password PHP script does not stop the form submitting. There is probably something very obvious I am doing wrong so hopefully someone will be able to spot this a mile away! :) The HTML looks like this, once the second form has been displayed form id=email-form action=procBasketEmailNoJS.php method=post input id=email class=texterwide type=text name=email/ input id=email-submit class=button type=submit value=Submit/ /form div id=email-response we have saved details on file for you, please enter your password below to retrieve them br/ form id=password-form onsubmit=callProcBasketPassword() action=procBasketPasswordNoJS.php method=post input id=password class=texterwide type=text name=password/ input id=password-submit class=button type=submit value=Submit/ /form /div div id=password-response name=password-response/ /div Here is the ajax.js // Attach handler to window load event Event.observe(window, 'load', init, false); function init(){ Event.observe('email-form', 'submit', callProcBasketEmail); } function callProcBasketEmail(e) { var pars = Form.serialize('email-form'); var myAjax = new Ajax.Updater('email-response', 'procBasketEmail.php', {method: 'post', parameters: pars}); Event.stop(e); } function callProcBasketPassword(e) { var pars = Form.serialize('password-form'); var myAjax = new
[Proto-Scripty] Re: how to use scripts without clicks
document.observe(dom:loaded, function() { // initially hide all containers for tab content $$('div.tabcontent').invoke('hide'); }); Note: you can of course do anything you want in that function. The function runs when everything is loaded and available to javascript. On Tue, Jul 28, 2009 at 12:02 PM, dmcgloned.mcgl...@att.net wrote: Hi everyone, I'm new to scriptaculous and javascript. I've followed the examples on scriptaculous web site, but I can't find any examples implement the events without them being links, such as when the page loads. currently what I'm trying to do is make a block of text fade in on the page when it loads. I've already got 1 script that I am playing with that zooms the header in, and the only way It works is to add a tag to the body tag of the document This seems to not allow me to add other stuff to the page unless they are links. My goal is to learn how to load more than 1 element on a page with 2 or more effects. My Google searches have turned up fruitless, does anyone know of any good tutorials or such? --~--~-~--~~~---~--~~ 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: drag between sortables - how to pass sortable id to db
you could probably just add the id to the params object directly before you pass it to the Ajax.Request On Thu, Jul 23, 2009 at 12:13 PM, johnb jbcen...@gmail.com wrote: I have a small app using sortables where you can re-order within them but also drag them between different sortables, saving both position within and which sortable they are in to a db. My problem: getting the order within each sortable is passing ok but I can't find the way to get the id of the sortable to pass. For example, the sortable is created as so: script type=text/javascript // ![CDATA[ Sortable.create('group_1',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem',onUpdate:updateList}); Sortable.create('group_'2',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem',onUpdate:updateList}); Sortable.create('page', {tag:'div',only:'section'||'mainsection',handle:'handle'}); // ]] /script Then when drag/drop the JS is activated: function updateList(container) { var url = 'ajax.php'; var params = Sortable.serialize(container.id) var ajax = new Ajax.Request(url,{ method: 'post', parameters: params, }); } This calls the Ajax which uses: $demo-updateList($_POST['group_1']); This passes all the group1[]=1 info ok. I just can't figure out how to have that Ajax use something like $demo-updateList($_POST [$x_groupvariable]); since I can't figure out how to assign the id of the sortable. Any help would be supremely appreciated. John --~--~-~--~~~---~--~~ 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: Which parameters are affected by Effect.Move()
If you know the original values of x and y you shouldn't have to know the current value to use effect.Move if you use mode: 'absolute' unless I am misunderstanding what you are trying to do, can you explain in a little bit more detail? (an example would be nice) On Thu, Jul 23, 2009 at 11:20 AM, tej ravi.kavalip...@gmail.com wrote: Hi, I have a project where I have 3 DIVs one on top of another and I have 3 anchors to show the contents of each DIV. if I click show 1 then divs 2 and 3 move to show div 1's content now if i click show 2 divs 2 and 3 move back to original position and followed by moving div 3 to show div2 content in order to do this i need to know the current x and y values of div2 to move back to its original value. or is there any way to do this?? i have used getDimentions and getStyles() but those values remain the same as i defined in the beginning.. If so.. what values of the element are changed when i use effect.Move (); any help is appreciated thanks in advance ravi --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---