Hey all
Ive ran into a bit of a problem when trying to parse multiple lines of javascript whitch are returned from an ajax request.
On the main page where the request orginates, i have a [HTML]<div id="top_left" />[/HTML]
I peform my ajax requests by using prototype as such:
Ive set up a test, where the php script that generates the response returns:
And this seems to work fine (text is shown, and alert alerts)
However when i try and send back the following nothing at all happens:
Im compleatly baffled, ive tried escaping every quote, writing it as a lot of innerHTML writes, by appendingChild, returning the javascript to iterate though an array of the text i want displayed and write it to top_left, but Nothing seems to work.
Im unsure if theres something crucial i'm missing, or something.
If anyone could point me in the right direction that would be awsome, as im stuck (for once google hasent solved it)
Also, does anyone have a good firefox extension or know of a tool for validating ajax javascript returns?
Thanks in advance
Ive ran into a bit of a problem when trying to parse multiple lines of javascript whitch are returned from an ajax request.
On the main page where the request orginates, i have a [HTML]<div id="top_left" />[/HTML]
I peform my ajax requests by using prototype as such:
Code:
function sendData(url, pars) { var myAjax = new Ajax.Request ( url, {method: 'get', parameters: pars, onLoading: showLoading, evalJS: true} ); }
Code:
$('top_left').innerHTML = 'test'; alert("test");
However when i try and send back the following nothing at all happens:
Code:
$('top_left').innerHTML= '<h1>Heading</h1><span title="title text">Welcome</span><ul><li id="search">Search here</li><li id="view">View here</li>'; new Draggable("search", {ghosting:true, revert:true}); new Draggable("view", {ghosting;true, revert: true} );
Im unsure if theres something crucial i'm missing, or something.
If anyone could point me in the right direction that would be awsome, as im stuck (for once google hasent solved it)
Also, does anyone have a good firefox extension or know of a tool for validating ajax javascript returns?
Thanks in advance
Comment