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

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

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

2009-08-18 Thread Richard Quadling
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

[Proto-Scripty] Re: Prototype Essentials

2009-08-18 Thread Tobie Langel
Prototype 2.0 will be separated into 3 modules: lang, dom and ajax. lang will be usable standalone. Best, Tobie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this

[Proto-Scripty] POSTing a form via AJAX

2009-08-18 Thread bill
I've read the docs, but can't seem to figure out how to POST a form via AJAX. I'm sure it is easy (as most prototype.js function calls are) but how ? I want the reply to update the div that holds the form (which itself was downloaded via AJAX). bill

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

2009-08-18 Thread T.J. Crowder
Hi, 'Tis indeed very easy. Say you have a form wrapped in a div: div id='formwrapper'form /form/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] Re: help with select on element not working

2009-08-18 Thread ColinFine
On Aug 10, 3:53 pm, molo maurice_lowent...@ssga.com wrote: Thanks so much T.J., that was the problem. I never would have gotten that Incidentally (and not on topic for your question) td/ is not valid in either HTML or XHTML. Also, td does not have a 'type' attribute. I believe browsers

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

2009-08-18 Thread drewB
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:

[Proto-Scripty] Re: Sortable.create and onHover

2009-08-18 Thread ColinFine
On Aug 10, 9:57 am, Sebastien seb.mar...@gmail.com wrote: Ok, thanks, but how would you implement my code then? Do I have to overload the whole Sortable.onHover method? If yes, then every new Sortable created will call the onHover method isn't it? I would like it to be called only for this

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

2009-08-18 Thread Walter Lee Davis
Don't forget the convenience wrapper Form.request, which hijacks the form's default settings and uses them to construct an Ajax request to the same endpoint using the same protocol. So that means: form id=myform action=myform.php method=post ... /form script ...

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

2009-08-18 Thread T.J. Crowder
Colin, Incidentally (and not on topic for your question) td/ is not valid in either HTML or XHTML. It's valid XHTML for an empty table cell. Also, td does not have a 'type' attribute. I believe browsers generally do let you set an arbitrary attribute (though I haven't found anything in

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

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

[Proto-Scripty] Re: Observing a checkbox

2009-08-18 Thread ColinFine
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) {        

[Proto-Scripty] Re: Ajax.InPlaceEditor in tables in IE6

2009-08-18 Thread ColinFine
- First case, using a div container (*) : Works as expected on IE8 and FF but on IE6 you have to click on the actual text to activate InPlace editing. (*) I am aware it is bad to put divs in tables, but so far that's the best working option :o( What's wrong with putting divs in tables

[Proto-Scripty] Re: Observing a checkbox

2009-08-18 Thread DJ Mangus
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()

[Proto-Scripty] Re: Dropping

2009-08-18 Thread ColinFine
On Aug 14, 1:32 pm, 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

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

2009-08-18 Thread DJ Mangus
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

[Proto-Scripty] Which parameters to stopObserving are optional?

2009-08-18 Thread Paul Lynch
I noticed in the code for stopObserving that it appears you can get away with just specifying the element, and then (perhaps) it cancels all observers for all events for that element. However, the documentation surprisingly does not mention this ability, but lists the element, event name, and

[Proto-Scripty] Re: Sortable onUpdate firing at the wrong time

2009-08-18 Thread ColinFine
On Aug 16, 7:50 am, JoJo tokyot...@gmail.com wrote: I think I figured it out. The callback must not have parentheses. FAIL:    onUpdate: someFunction(); GOOD: onUpdate: someFunction; I have no idea why.  I am a beginner to JS. Because onUpdate: someFunction() means Call 'someFunction'

[Proto-Scripty] Re: Which parameters to stopObserving are optional?

2009-08-18 Thread Alex McAuley
$('foo').stopObserving(); will stop observing all observers on id=foo $('foo').stopObserving('click'); will stop click observers on id=foo $('foo').stopObserving('change'); will stop change observers on id=foo i think you get the idea! HTH Alex Mcauley http://www.thevacancymarket.com

[Proto-Scripty] Re: Dropping

2009-08-18 Thread Floyd Resler
That is an excellent solution! Thanks! Floyd On Aug 18, 2009, at 1:05 PM, ColinFine wrote: On Aug 14, 1:32 pm, 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

[Proto-Scripty] Re: checked !status in line 1496? (prototype-1.6.1.RC3)

2009-08-18 Thread Ken Snyder
Yes! The core devs do need to address whether or not this Ajax.Request#getStatus() behavior will be fixed. All non-HTTP requests (namely file:) return a status of 0. A function like the following needs to be added, probably in Ajax.Request#getStatus() isHttp: function() { var pcol =

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

2009-08-18 Thread drewB
As I see it the advantages of doing it client-side are: - The server can handle more users because less work is done there - Cleaner delineation for presentation layer. If I want to change the way things look, there are fewer places I need to go. - Possibly better user experience because there

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

2009-08-18 Thread milko
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 this. The link is: http://www.cartesians.com/geefeenster/ajax_test.html It should show the text: Hello world. The code of the

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

2009-08-18 Thread Remah
I am trying to call a JS file using Ajax.Request that will return a javascript function. This function will be used by code taht will be injected into a div. Is this possible? It seems like the function is accessible within the CallBacks of Ajax.Request, but they are not accessible outside.

[Proto-Scripty] Nested updater calls , weird result

2009-08-18 Thread dweeves
Hi , i'm using Ajax.Updater in a nested way. here is a pseudo-code of my use case First pass main_div a onclick=updateDivWithAjaxUpdater(sub_div)load subdiv/a sub_div /subdiv /main_div Second pass, sub_div is filled with something like that a

[Proto-Scripty] Re: Nested updater calls , weird result

2009-08-18 Thread T.J. Crowder
Hi, How 'bout a NON-pseudo, standalone example? Because there are a number of things in that pseudo that could be tripping you up, but I figure most of them are because it's pseudo... -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On

[Proto-Scripty] Re: Observing a checkbox

2009-08-18 Thread Kevin Porter
Yep, too many browser differences, use click. Some browsers fire onchange event as soon as you change the value, others (IE in fact) only fire the event after the checkbox loses focus. Good explanation here: http://video.yahoo.com/watch/4943143/13163203 (at about time -41:46). regards, -

[Proto-Scripty] Re: checked !status in line 1496? (prototype-1.6.1.RC3)

2009-08-18 Thread Tobie Langel
An ajax revamp is planned for 2.0. Best, Tobie On Aug 18, 4:55 pm, Ken Snyder kendsny...@gmail.com wrote: Yes! The core devs do need to address whether or not this Ajax.Request#getStatus() behavior will be fixed. All non-HTTP requests (namely file:) return a status of 0. A function like

[Proto-Scripty] Re: Which parameters to stopObserving are optional?

2009-08-18 Thread T.J. Crowder
Hi, It's documented here[1], which is where you get with the links in the API TOC. It also appears there's an outdated page here[2] (note the capitalisation) that does not mention this. Scary. Can't wait until we ditch this Mephisto stuff for the 1.6.1 generated docs. [1]

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

2009-08-18 Thread T.J. Crowder
Hi, They're accessible from anywhere after they're evaluated, but mind how you declare them, because of a bit of a quirk about how they're evaluated. There's a badly misplaced note about this in the documentation, at the bottom of the discussion of Ajax.Updater[1]. It really should be in the

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

2009-08-18 Thread Miguel Beltran R.
maybe http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically 2009/8/18 Remah donnie.carva...@tfmx.com I am trying to call a JS file using Ajax.Request that will return a javascript function. This function will be used by code taht will be injected into a div. Is this

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

2009-08-18 Thread RobG
On Aug 19, 5:30 am, drewB dbats...@gmail.com wrote: As I see it the advantages of doing it client-side are: - The server can handle more users because less work is done there Unlikely. There is very little difference in computation effort between generating JSON, XML, HTML or delimited text

[Proto-Scripty] Re: checked !status in line 1496? (prototype-1.6.1.RC3)

2009-08-18 Thread Ken Snyder
yay! On Tue, Aug 18, 2009 at 3:36 PM, Tobie Langel tobie.lan...@gmail.comwrote: An ajax revamp is planned for 2.0. Best, Tobie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us