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:
Expand|Select|Wrap|Line Numbers
- function sendData(url, pars) {
- var myAjax = new Ajax.Request ( url, {method: 'get', parameters: pars, onLoading: showLoading, evalJS: true} );
- }
Expand|Select|Wrap|Line Numbers
- $('top_left').innerHTML = 'test';
- alert("test");
However when i try and send back the following nothing at all happens:
Expand|Select|Wrap|Line Numbers
- $('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