[Proto-Scripty] Object from string

2011-07-09 Thread kstubs
I hope I haven't asked this before!! OK, so if have a name string like this: var name = 'somename' + x// assuming x = 1 and some value = '1234' I need the object: { somename1: '1234' } But I can't figure out how to get here. Please help. Karl.. -- You received this message

[Proto-Scripty] Re: Object from string

2011-07-09 Thread kstubs
OK, I figured it out. Here is my solution, and ultimately I need an Object, as you can see I'm extending args in the end, so is there a way to avoid creating the hash, then casting the hash to an object? var idx = itt + 1; var name = 'p_Value' + idx.toString();

Re: [Proto-Scripty] Re: Object from string

2011-07-09 Thread Joseph Spandrusyszyn
var idx = itt + 1; var name = 'p_Value' + idx.toString(); var h = {}; h[name] = names[itt]; On Jul 9, 2011 4:24 AM, kstubs kst...@gmail.com wrote: OK, I figured it out. Here is my solution, and ultimately I need an Object, as you can see I'm extending args in the end, so is there a

[Proto-Scripty] History and onpopstate

2011-07-09 Thread pedz
My first attempt to use HTML 5's onPopState isn't working. I did: $$('body')[0].on('popstate', Raptor.makeWrapper(function(event) { console.log('popped'); })); I've tried a few different capitalizations but, so far, it isn't logging the 'popped' message. Any suggestions on how to

Re: [Proto-Scripty] Re: Object from string

2011-07-09 Thread kstubs
Wow, you just have to love Javascript, so flexible sometimes! What an amazing language, I tell ya. Thanks for that shortcut ilandril! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit

[Proto-Scripty] Re: History and onpopstate

2011-07-09 Thread pedz
This isn't using prototype but works: window.onpopstate = function (even) { ... }; new Event.Handler(element, ...) requires element be an element. window doesn't work. Not a big deal. I'm using Firefox 5. I don't know (yet) how portable the above is going to be. -- You received this

[Proto-Scripty] Event Keyup a-z key response

2011-07-09 Thread kstubs
Is there a clever way to ignore all other keystrokes, like arrow keys and only responsd to keycodes ranging from a-z and 0-9? I guess another valid keystroke would be SHIFT+a-z. So something like: onKeyUp: function(e) { // if not valid keystroke event return; // otherwise, do the

[Proto-Scripty] Help destroying many events on tr mouseenter and mouseleave

2011-07-09 Thread kstubs
I have something like this: tr.on('mouseenter',thiz.Mousing.bindAsEventListener(thiz)); tr.on('mouseleave',thiz.Mousing.bindAsEventListener(thiz)); This table is built frequently (every few keystrokes by the user) so I need to setup the mouseenter and mouseleave event