[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-08-05 Thread Drum
    $(div).update(thereturn); That did the trick! It's true that I don't make as much use of prototype as I could or should. Most of the js/ajax on the site is written from scratch (way back when I was learning how to use ajax). I added prototype later on to do some of the 'bells and

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-08-04 Thread T.J. Crowder
Hi, if (http_request.readyState == 4) { if (http_request.status == 200) { document.getElementById('load').innerHTML = ; You're not using Ajax.Request[1] or Ajax.Updater[2]? This is my onSuccess handler, how do I apply evalScripts?

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-08-03 Thread Drum
if you need to do it yourself, you'd use String#evalScripts on the responseText member of the Ajax.Response passed into your onSuccess handler. Sorry, I still don't understand. This is my onSuccess handler, how do I apply evalScripts? if (http_request.readyState == 4) {

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-08-02 Thread T.J. Crowder
Hi, I wasn't talking about String#evalScripts function, I was talking about the evalScripts *option* on Ajax.Updater: http://prototypejs.org/api/ajax/updater If you're not using Ajax.Updater, if you're doing the update yourself, Element#update[1] will eval the scripts for you as part of its

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-08-01 Thread Drum
Ah, now, that's interesting. I did try to use evalScripts, but I couldn't find any clear examples of how or where to apply it. I tried putting it in the places it seemed logical, but without effect. So, ok, I have an HTML page includes an onclick to fetch some content which will include scripts.

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-07-31 Thread T.J. Crowder
Hi, You're using the evalScripts option in your ajax call? Can you produce a small, self-contained example[1]? [1] http://proto-scripty.wikidot.com/self-contained-test-page -- T.J. :-) On Jul 31, 1:22 am, Drum csteph2...@gmail.com wrote: P.S. I tried with both delete eds[id];  and eds[id] =

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-07-30 Thread Drum
Ok, thanks. I think I understand the reasoning here, but I can't get my actual example to work. This is the script as it appears in the initially loaded page and also as it is in the html snippets bought in by ajax. div id=kwdisp0101some keyword/div script if(editor0101){ editor0101.dispose();

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-07-30 Thread T.J. Crowder
Hi, Really close. :-) But you're running afoul of how eval handles the var statement. (If you'd just left the var statement out entirely, it probably would have worked thanks to the horror of implicit globals [1], but you'd be cluttering up the window namespace something fierce.) Also,

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-07-30 Thread Drum
Sorry, but it's still not working for me. I have my main page as it initially loads with this in the HEAD script language=javascript type=text/javascript var ipeManager = { editors: {}, addOrReplaceEditor: function(id, url, size, paramstr){ var eds; eds = this.editors;

[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-07-26 Thread T.J. Crowder
Hi, If you replace an element, even if the replacement has the same ID as the original, you will have toinitialize a new InPlaceEditor. It grabs a reference to the element instance, which is different for the replacement than for the original. It would be best to *also* remove the