[Proto-Scripty] Adding method to Object to be able to iterate over a json property

2009-05-29 Thread dgalvez
the point is, sometimes i receive a json object like var json = { element: ['1','2','3'] } and sometimes element has just one element so it is presented as a String not an Array: var json = { element: '1' } And i want to iterate over

[Proto-Scripty] white style.display to use to 'pre-hide' collapsible elements?

2009-05-29 Thread lawpoop
Hello all - I'm using scriptaculous' Effect.blindup and blinddown effect to create a tree menu. It's basicalled nested divs with indentation. When the page loads, I want the tree to be completely collapsed. I tried setting the inline style for each div to visibility: hidden, but then

[Proto-Scripty] How to Serialize an object to JSON?

2009-05-29 Thread sshah
Hello I need to serialize an object to JSON, but the following code returns: Stack overflow at line: 547 var windowHandle = ; function openWindow2(URL) { windowHandle = window.open(URL,'capswin','toolbar=no,resizable=1') var windowStr = Object.toJSON(windowHandle);

[Proto-Scripty] Trouble getting started with Prototype

2009-05-29 Thread Alex
Hey, I'm new to Javascript but not to programming. I decided to use prototype because of the helpful functions it appeared to offer. Here is what I have in a nutshell: SCRIPT type=text/javascript src=javascriptPrototype.js / SCRIPT type=text/javascript function editInfo() {

[Proto-Scripty] Re: Trouble getting started with Prototype

2009-05-29 Thread Chris Sansom
At 22:10 -0700 28/5/09, Alex wrote: SCRIPT type=text/javascript src=javascriptPrototype.js / ... The Prototype functions are in javascriptPrototype.js. I am trying to remove (or delete the contents of if someone has a better idea) the div element with id=box. I get an error everytime in IE 7.

[Proto-Scripty] Re: add more paramaters to call on a observe?

2009-05-29 Thread T.J. Crowder
Hi Miquel, You have a couple of choices: Function#bind[1] (you could use Function#curry if you didn't need context, but I see you do) or Function#bindAsEventListener[2]. They basically come to the same thing, it's just a matter of whether your function receives the event parameter as the first

[Proto-Scripty] Re: Ajax.Request and IE 8

2009-05-29 Thread T.J. Crowder
Hi, Is there are workaround to get this working in IE 8? Not a workaround, a fix: Don't put false in quotes (in your asynchronous option); it's a flag, not a string. (I'm surprised the results vary, truth be told.) [OT: Do you really, really need the call to be synchronous? You can't

[Proto-Scripty] Re: prototype insert() appears to lose inline javascript when using IE over remote desktop

2009-05-29 Thread T.J. Crowder
@Miguel: ...because parameter position need be string No, it doesn't. When you use that style of insert, you're handing it an object (in this case, via an object literal) where the name(s) of the property on the object dictate where the content is put. bottom is a property name, which you

[Proto-Scripty] Re: Adding method to Object to be able to iterate over a json property

2009-05-29 Thread Richard Quadling
2009/5/29 dgalvez danielgalvezvalenzu...@gmail.com:  the point is, sometimes i receive a json object like      var json = {          element: ['1','2','3']      }      and sometimes element has just one element so it is presented as a String not an Array:      var json = {          

[Proto-Scripty] Re: Adding method to Object to be able to iterate over a json property

2009-05-29 Thread T.J. Crowder
Hi, A brief OT before the actual question, you can make your each call more efficient. Instead of: objectToArray(json.element).each(function(ele){ ... }.bind (this)); use each's second param, 'context': objectToArray(json.element).each(function(ele){ ... }, this); Enumerable#each

[Proto-Scripty] Re: white style.display to use to 'pre-hide' collapsible elements?

2009-05-29 Thread T.J. Crowder
Hi, Sorry, completely messed up my comments at the end there. Let's try that again: div id='foo' style=display: noneBlah blah blah/div // Make 'foo' appear new Effect.BlindDown('foo'); // Make 'foo' disappear (later) new Effect.BlindUp('foo'); -- T.J. On May 29, 11:23 am, T.J. Crowder

[Proto-Scripty] Re: How to Serialize an object to JSON?

2009-05-29 Thread david
Hi sshah, I've never done that, but isn't there a way to save the window name instead and close a windows depending on it's name after?? That could do something like that: var windowHandle = ; var windowList={}; var windowNumber=1; function openWindow2(URL) { var

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread WLQ
What I can't understand Walter is why have we written 27 messages about anything which is not related to the question. And have spend on that nearly a month not getting even closer to the answer. See misunderstanding lead us to write answers that we don't need. But what I think now is: if we

[Proto-Scripty] Re: How to Serialize an object to JSON?

2009-05-29 Thread Suneet Shah
Hi David Thanks for the reply. You are right that we can save the window variable in an array and that works just fine. However, the problem is maintaining this information across requests. ie. I can open the window on 1 page and click on the close window link a few requests later. Is there

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread Alex McAuley
you dont need a grid... you can the id is that of the ones above plus 1 ... This will not work properly due to ID's conflicting Each time an element is dropped you will need to re-assign id's to each element.. something like this ... div id=container-1 !-- Droppable -- liItem/li

[Proto-Scripty] Re: Adding method to Object to be able to iterate over a json property

2009-05-29 Thread disccomp
I came across this quirk in PHP as well. IMHO, it is much better to fix the code on the server side than it would be to mess with (correctly functioning) code on the client. -Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Proto-Scripty] Re: Adding method to Object to be able to iterate over a json property

2009-05-29 Thread Richard Quadling
2009/5/29 disccomp discc...@gmail.com: I came across this quirk in PHP as well. IMHO, it is much better to fix the code on the server side than it would be to mess with (correctly functioning) code on the client. -Mark Quirk? I don't think this is a quirk. At what stage should a string

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread Alex McAuley
To be honest i dont understand what Walter is trying to say... for example drag an unlimited number of copies from the first list into the second list, and have the dropped elements keep their place in the second list while the first list remains exactly the same... means the same to me

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread WLQ
Yes, but also both of the sortables lists are driven by MySQL database, by different tables. Basically the question is how can it know between which items the item is dropped. And when it's done that it must copy an item (MySQL row) from one MySQL table to another, and also change it's ID's to

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread WLQ
Of course then it must update and rebuild the list using the order defined by the item ID. Yes, but also both of the sortables lists are driven by MySQL database, by different tables. Basically the question is how can it know between which items the item is dropped. And when it's done that

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread Alex McAuley
Well thats the easy part believe it or not the container should have the table name in the id or classname somewhere then that can be pushed to the request.. (problem one taken care of)!! Problem 2 - copying rows I would arrange my database something like this. id |

[Proto-Scripty] Re: Trouble getting started with Prototype

2009-05-29 Thread Alex
Chris, What I downloaded from Prototype was titled: prototype-1.6.0.3.js. I renamed that file to javascriptPrototype.js so that I could use it. I uploaded it into my directory. And from there I got to the question I had above. Does that clear anything up or help at all? Is there anything

[Proto-Scripty] Re: MySQL - order ID

2009-05-29 Thread WLQ
It would be very best of you if you just maid an example. 'Couse it's kind of confusing )) Thanks, Yan Well thats the easy part believe it or not the container should have the table name in the id or classname somewhere then that can be pushed to the request.. (problem one taken

[Proto-Scripty] Re: Trouble getting started with Prototype

2009-05-29 Thread Mitchell McCulloch
Alex, I retraced your steps in downloading and renaming prototype, and it still seems to work fine for me, so that doesn't appear to be the issue. Is the error message somewhat helpful to be posted? Also, have you tried using other prototype functions? If not, I'd do some simple error checking

[Proto-Scripty] Trouble getting started with Prototype

2009-05-29 Thread Chris Sansom
At 06:07 -0700 29/5/09, Alex wrote: What I downloaded from Prototype was titled: prototype-1.6.0.3.js. I renamed that file to javascriptPrototype.js so that I could use it. I uploaded it into my directory. And from there I got to the question I had above. Does that clear anything up or help at

[Proto-Scripty] Re: Trouble getting started with Prototype

2009-05-29 Thread Russell Keith
It appears the script tag must have a closing tag /script. So this SCRIPT type=text/javascript src=javascriptPrototype.js / Should be this SCRIPT type=text/javascript src=javascriptPrototype.js/script Russell -Original Message- From: prototype-scriptaculous@googlegroups.com

[Proto-Scripty] Re: Trouble getting started with Prototype

2009-05-29 Thread Mitchell McCulloch
Ah! I didn't look too closely at that I guess, whoops. Indeed that should solve the problem for Chris. -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Russell Keith Sent: May 29, 2009 9:41 AM To:

[Proto-Scripty] Trouble getting started with Prototype

2009-05-29 Thread Chris Sansom
At 10:01 -0400 29/5/09, Mitchell McCulloch wrote: Ah! I didn't look too closely at that I guess, whoops. Indeed that should solve the problem for Chris. No problem for me - at least, not /that/ problem. :-) I was the one who suggested he had the filename wrong when he didn't. The original

[Proto-Scripty] Re: Trouble getting started with Prototype

2009-05-29 Thread Alex
Thank you everyone. The problem was the absense of the /script. --~--~-~--~~~---~--~~ 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

[Proto-Scripty] Re: prototype insert() appears to lose inline javascript when using IE over remote desktop

2009-05-29 Thread Miguel Beltran R.
2009/5/29 T.J. Crowder t...@crowdersoftware.com @Miguel: ...because parameter position need be string No, it doesn't. When you use that style of insert, you're handing it an object (in this case, via an object literal) where the name(s) of the property on the object dictate where the

[Proto-Scripty] Re: add more paramaters to call on a observe?

2009-05-29 Thread Miguel Beltran R.
(And again, if you didn't need context, you could use Function#curry [3] and the event would be the last parameter.) Thanks T.J., with curry has enough --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype