Topic: execute javascript tags in response, try this :D

Hi ppl,

it would very great if you enable javascript tags in the responses. ive got an little function from prototype and mootools big_smile

function parse_js(data){       
    var scripts = '';
    var text = data.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){
        scripts += arguments[1] + '\n';
        return '';
    var script = document.createElement('script');
    script.setAttribute('type', 'text/javascript');
    script.text = scripts;

if tried it on the assign/append function in the js core: xajax.dom.append = function(element, property, data) {...... parse_js(data);

and i wrote in my PHP code:
    $objResponse->append('kalender', "innerHTML", '
        <script type="text/javascript">
            var testmy = 509;

and it works! the testmy is in the watch from my firebug and the alert works too big_smile

Re: execute javascript tags in response, try this :D

Hm, I like it! It's the perfect solution for lazy coders, hehe big_smile