If you want to treat the HTML and script as thought it were just text,
you can't use Ajax.Updater.  You'll have to use Ajax.Request instead,
e.g.:

    new Ajax.Request(your_url, {
        onSuccess: function(transport) {
            // At this point, the *text* of the response is
            // available as transport.responseText.
            // You can do anything with it you like.
            // Here's one thing you can do with it, written
            // in separate lines for clarity:
            var text;
            text = transport.responseText;
            text = text.replace(/\&/g, "&");
            text = text.replace(/\</g, "&lt;");
            text = text.replace(/\>/g, "&gt;");
            $('some_div').update(text);
        }
    });

That's not tested code, but the basic idea is:  Get the text, escape
the tags, write it out to a div.  Because the tags are escaped, they
won't be processed as tags (in theory).

FWIW,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Feb 26, 12:59 pm, erling <erl...@spekk.no> wrote:
> Hi
>
> I have the same problem,
>
> > If I understand you correctly, you don't want to execute thescript
> > tags, they're just text to be put in a text area.
>
> Yes in to an DIV conteiner, i use  Ajax.Updater
>
> > FWIW, I'd probably just use an Ajax.Request and set the value of the
> > target text area directly from onSuccess.
>
> can you explain this for me pleas..
>
> I get the HTML data that also contains some <script>, but when I use
> Ajax.Updater then disappear all of <script> I do not want to do
> something with the script, will only add it along with other HTML
> tags.
>
> What am I doing wrong, or how to set up  Ajax.Updater to not change
> the script.
>
> Thanks Erling
>
> On 25 Jan, 13:29, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
>
> > Hi,
>
> > If I understand you correctly, you don't want to execute thescript
> > tags, they're just text to be put in a text area.
>
> > If you look at the code in Ajax.Updater, it looks like if you have
> > evalScripts turned off, it strips out the scripts before updating the
> > target element (because it passes the text on to Element#update, which
> > will execute the scripts if they're there).
>
> > FWIW, I'd probably just use an Ajax.Request and set the value of the
> > target text area directly from onSuccess.
>
> > HTH,
> > --
> > T.J. Crowder
> > tj / crowder software / com
> > Independent Software Engineer, consulting services available
>
> > On Jan 25, 8:02 am, majestixx <majestixx...@gmail.com> wrote:
>
> > > Hi,
> > > I am a writing on an Advertisement Manager,
> > > in this it should be possible to edit Advertisement Codes in a Textbox
> > > (normal Textarea),
> > > but I have a problem loading the codes from the database to the
> > > textarea via prototypes ajax.updater.
> > > In the response of the ajax request thescriptis still there (checked
> > > with firebug), but in the textarea nothing arrives.
>
> > > I also tried the parameters     evalJS: false, evalScripts: false but
> > > nothing changed.
>
> > > Can you help me? What am I making wrong. I want these javascripts just
> > > handled as normal text and nothing to be executed.
>
> > > My JS-Code:
> > > var myAjax      = new Ajax.Updater(
> > >         { success: targetFormFieldset },
> > >         "adv.ajax.php5", {
> > >                 method: "get",
> > >                 evalJS: false,
> > >                 evalScripts: false,
> > >                 parameters: {
> > >                         get: "banConfigForm",
> > >                         banID: banID
> > >                 },
>
> > >                 onComplete: function(transport) {
> > >                         toggleView("ajaxStatusIndicator", "hide");
> > >                         if(transport.status>=200 && transport.status<300) 
> > > {
> > >                                 toggleView("ajaxBg", "show", 
> > > function(effectObject) {
> > >                                         toggleView("ajaxConfigWindow", 
> > > "show");
> > >                                         $("featureConfigForm").enable();
>
> > >                                         // Focus first form element
> > >                                         
> > > if($("featureConfigForm").findFirstElement())
> > >                                                 
> > > $("featureConfigForm").focusFirstElement();
>
> > >                                         } // End of afterFinish function
>
> > >                                 ); // End of toggleView("ajaxBg")
>
> > >                         }
> > >                 },
>
> > >                 onFailure: function(transport) {
> > >                         printError("Unable to load the feature 
> > > configuration form.",
> > > transport);
> > >                 }
> > >         }
> > > );– Skjul sitert tekst –
>
> > – Vis sitert tekst –
>
>
--~--~---------~--~----~------------~-------~--~----~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---