[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread T.J. Crowder
Hi, I haven't been into the details of your specific situation, I just happened to notice the suggestion to bind when using map and it jumped out at me. But generally: Say `this` points to an instance that has a flurgle property with the value "bar". And so: alert(this.flurgle); ...alerts "b

[Proto-Scripty] Re: Div Fades

2009-08-20 Thread Alex McAuley
Jason. How are you calling these functions ? Are you using an tag by any chance Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "Jason Frisvold" To: Sent: Thursday, August 20, 2009 9:17 PM Subject: [Proto-Scripty] Div Fades > > Hi there, > > I'm using appe

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread Andy Daykin
I tried the first suggestion, but the function still isn't getting called. TJ, can you explain more, or show an example of what the context param would look like? Should I just put the doSlide function as the 2nd parameter? -Andy -- From: "T.J. C

[Proto-Scripty] Re: help with select on element not working

2009-08-20 Thread T.J. Crowder
Thanks, Colin, glad it was something like that. -- T.J. :-) On Aug 20, 5:43 pm, ColinFine wrote: > On Aug 20, 9:39 am, "T.J. Crowder" wrote: > > > Hi Colin, > > > > > > Incidentally (and not on topic for your question) > > > > > > > > > > is not valid in either HTML or XHTML. > > > > > It's v

[Proto-Scripty] Div Fades

2009-08-20 Thread Jason Frisvold
Hi there, I'm using appear and fade with a hidden div to display additional information about data in a table. This all works wonderfully with one caveat. Whenever the fade is called, the page jumps to the top, making the user have to scroll back down again. Am I doing somethin

[Proto-Scripty] Re: POSTing a form via AJAX

2009-08-20 Thread Alex McAuley
I replied to you with an example. I wrote Bill You need to observe the form submit. $('the-id-of-the-form').observe('submit',function(event) { /// do the ajax that TJ said... Event.stop(event); // will stop it doing its default action! }); Alex Mcauley http://www.thevacanc

[Proto-Scripty] Re: help with select on element not working

2009-08-20 Thread ColinFine
On Aug 20, 9:39 am, "T.J. Crowder" wrote: > Hi Colin, > > > > > Incidentally (and not on topic for your question) > > > > > > > > is not valid in either HTML or XHTML. > > > > It's valid XHTML for an empty table cell. > > > Wrong. It's a common misconception (which I had myself until > > recen

[Proto-Scripty] Re: Automatically Converting HTML to DOM (e.g. new Element ...)

2009-08-20 Thread DJ Mangus
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 wrote: > >>U

[Proto-Scripty] Re: POSTing a form via AJAX

2009-08-20 Thread bill
bill wrote: > T.J. Crowder wrote: >> Hi, >> >> 'Tis indeed very easy. Say you have a form wrapped in a div: >> >> >> >> >> >> You can post it like so and take the result (which is presumed to be >> an HTML snippet in this case) and use that to update the container: >> >> new

[Proto-Scripty] Re: POSTing a form via AJAX

2009-08-20 Thread Alex McAuley
Bill You need to observe the form submit. $('the-id-of-the-form').observe('submit',function(event) { /// do the ajax that TJ said... Event.stop(event); // will stop it doing its default action! }); Alex Mcauley http://www.thevacancymarket.com - Original Message - From: bill

[Proto-Scripty] Re: Automatically Converting HTML to DOM (e.g. new Element ...)

2009-08-20 Thread drewB
>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 in

[Proto-Scripty] Re: Prototype breaks the IE8 native JSON parser.

2009-08-20 Thread T.J. Crowder
Tobie, What's the issue #? I'm curious how Prototype can work around this IE8 behavior... Cheers, -- T.J. On Aug 20, 1:04 pm, Tobie Langel wrote: > This is a Prototype bug and will be fixed in  version 1.7. > > In the meantime, please use Object.toJSON(...) instead. > > Best, > > Tobie > > O

[Proto-Scripty] Ajax requests again

2009-08-20 Thread Alex Mcauley
earlier on in the month i posted on how to do some things with Ajax requests genericaly like adding a loading message to all requests and i got a couple of responses but not many. I've been giving it alot of thought and i cam up with addMethods as a way to add some things to the Ajax Class... Co

[Proto-Scripty] Re: POSTing a form via AJAX

2009-08-20 Thread bill
T.J. Crowder wrote: > Hi, > > 'Tis indeed very easy. Say you have a form wrapped in a div: > > > > > > You can post it like so and take the result (which is presumed to be > an HTML snippet in this case) and use that to update the container: > > new Ajax.Updater('formwrapper

[Proto-Scripty] effect.multiple and effect.scale

2009-08-20 Thread blr21560
Hi, I run this line : Effect.multiple( tab, Effect.Scale); There are no effect. tab is an an array with two div elements. I run this line Effect.multiple( tab, Effect.Fade ); It's ok; Why ? Thanks, Bernard --~--~-~--~~~---~--~~ You received

[Proto-Scripty] Re: help with select on element not working

2009-08-20 Thread ColinFine
On Aug 20, 9:39 am, "T.J. Crowder" wrote: > Hi Colin, > > > > > Incidentally (and not on topic for your question) > > > > > > > > is not valid in either HTML or XHTML. > > > > It's valid XHTML for an empty table cell. > > > Wrong. It's a common misconception (which I had myself until > > recen

[Proto-Scripty] Re: Order in $H(responseJSON.Data)

2009-08-20 Thread Tobie Langel
Or better, yet, use an array. On Aug 20, 2:06 pm, david wrote: > Hi Buda, > > you can't rely on browser internal way to store JSON. Each as its own > way. > The only thing you can do is to call a sort() function but in that > case you'll also loose original order.** > > One thing I can propose i

[Proto-Scripty] Re: ajax.request routine fails in IE

2009-08-20 Thread yuval dagan
hi Im using here ie 6 and it works. but, in ie the dom is ready only when the document is loaded so sometimes refering to an element is impossible before the dom is loaded. try moving the function call to the onload: On 8/20/09, david wrote: > > > Hi Milko, > > which version of IE, because

[Proto-Scripty] Re: ajax.request routine fails in IE

2009-08-20 Thread david
Hi Milko, which version of IE, because I test it with IE6, and it wotks. -- david On 18 août, 18:18, milko wrote: > Hello, > > I made an ajax-routine using request and json, which works fine under > all browsers except under IE. > For the sake of illustration I made a simplified version of thi

[Proto-Scripty] Re: Order in $H(responseJSON.Data)

2009-08-20 Thread david
Hi Buda, you can't rely on browser internal way to store JSON. Each as its own way. The only thing you can do is to call a sort() function but in that case you'll also loose original order.** One thing I can propose is to modify data to have an numerical index to your data so calling a sort() fu

[Proto-Scripty] Re: Prototype breaks the IE8 native JSON parser.

2009-08-20 Thread Tobie Langel
This is a Prototype bug and will be fixed in version 1.7. In the meantime, please use Object.toJSON(...) instead. Best, Tobie On Aug 20, 10:53 am, "T.J. Crowder" wrote: > Hi, > > Wait! Stop the presses, are you saying IE8 has...a bug in it? ;-) > (Oh, I shouldn't be mean to Microsoft, all br

[Proto-Scripty] Order in $H(responseJSON.Data)

2009-08-20 Thread buda
I have a problem: from server I receive such JSON string (resp.responseJSON.Data) { "Data": { "ABC": "6", "NUI": "1", "ITM": "10" . } } where elements in Data have the apropriate order When I do $H(responseJSON.Data) - I have hash object with different order of elemen

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread T.J. Crowder
Hi, Rather than binding it, use the second parameter to map (aka collect [1]), that's what the second param ("context") is for. You'll find that most of the Enumerable methods that take callbacks also take a context parameter so the callback can be a method. [1] http://prototypejs.org/api/enume

[Proto-Scripty] Re: to NEW or not to NEW, that is the question

2009-08-20 Thread T.J. Crowder
Hi, In general, the correct thing is what the docs[1] say it is. Fade, Appear, and most others are just functions, not constructor functions, and so "new" is not correct. Some other things, like Effect.Opacity [2] (which confusingly use *exactly* the same capitalization -- don't shoot the messe

[Proto-Scripty] Re: Prototype breaks the IE8 native JSON parser.

2009-08-20 Thread T.J. Crowder
Hi, Wait! Stop the presses, are you saying IE8 has...a bug in it? ;-) (Oh, I shouldn't be mean to Microsoft, all browsers have bugs in them, and they seem to have made quite an effort in IE8.) Have you reported the bug to Microsoft? Seriously, though, thank you for doing the research to why it

[Proto-Scripty] Re: Using Ajax.Request and evalJS to load functions on the fly

2009-08-20 Thread T.J. Crowder
Hi, Can you post a minimal, self-contained example[1] of the problem? [1] http://proto-scripty.wikidot.com/self-contained-test-page -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 19, 2:39 pm, "Donnie Carvajal" wrote: > HI T.J.,

[Proto-Scripty] Re: help with select on element not working

2009-08-20 Thread T.J. Crowder
Hi Colin, > > > Incidentally (and not on topic for your question) > > > > > > is not valid in either HTML or XHTML. > > > It's valid XHTML for an empty table cell. > > Wrong. It's a common misconception (which I had myself until > recently). If so, it's a misconception the W3C's own validator s

[Proto-Scripty] Re: onclick functionality in ajax

2009-08-20 Thread Alex McAuley
You need to re-observe the listeners Perhaps a pastie of your code would help us help you.. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "hass" To: "Prototype & script.aculo.us" Sent: Thursday, August 20, 2009 12:19 AM Subject: [Proto-Scripty] onclick f

[Proto-Scripty] Re: onclick functionality in ajax

2009-08-20 Thread T.J. Crowder
Hi, When you replace an element, the old element is no longer displayed (ideally it no longer exists) and a new element is put in its place. Any event handlers associated with the old element are not automatically transferred to the new one. There are a couple of ways to handle this: 1. Event D

[Proto-Scripty] Re: Traversing XML w/ Prototype (DOMParser)

2009-08-20 Thread Szymon Wilkołazki
louis w wrote: > Please check out the code below. I am having a hard time getting the > protortype selectors to be applied to this item. Hoping to avoid > having to use childNodes to parse this data. > > var xml = 'OK'; > > var parser = new DOMParser(); >

[Proto-Scripty] onclick functionality in ajax

2009-08-20 Thread hass
I have set up a relatively straight forward scenario where i have a listener for event A. On click of A (a button), I run an ajax request to update a div B. B was a large div, representing one of 3 panels on a page. B had some javascript functionality (lets call this event C) inside of it which

[Proto-Scripty] Re: to NEW or not to NEW, that is the question

2009-08-20 Thread Alex McAuley
new defines an new instance of an Object / class. Some things dont need "new" and some do. It has nothing to dow tih Cross browser afaik Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "Mojito" To: "Prototype & script.aculo.us" Sent: Thursday, August 20, 2009

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread Daniel Rubin
Andy Daykin wrote: > Hello, I am having some difficulties writing a class, in my code I have a > class where I need to be able to bind event listeners to values. In my code I > want the variable pointerIndex to be accessible outside of the initialize > function, but right now it is not. If I ma