[opencms-dev] XmlHttpRequest and OpenCms Direct Edit

Roman Uhlig roman.uhlig at knve.de
Thu Nov 16 18:57:07 CET 2006


Hi,

I'm currently trying to implement some simple asynchronous functionality by
using XMLHttpRequest inside OpenCms. So far everything is working as
expected, except the rendering of OpenCms direct edit buttons. They don't
get displayed. This is quite strange, since I'm not doing anything unusual.

The generated HTML response from XMLHttpRequest is valid and contains
everything a page with direct edit functionality needs (CSS and JavaScript
inside the head). If I call this page directly without XMLHttpRequest,
everything works fine. As soons as I load it inside another page by using
XMLHttpRequest, the direct edit buttons don't show up. I'm using it like
this:

JSP:

...
<div id="async_content">
</div>
<input type="button" value="Load async content"
onClick="loadCnt('async_content', '<%= cms.link(some_page_with_direct_edit)
%>'">
...


JavaScript:

var objId = "";
function loadCnt(id, src) {
...
http_request = new XMLHttpRequest();
...
http_request.open('GET', src, true);
http_request.send();
document.getElementById(id).innerHTML = http_request.responseText;
}



That's basically all. Does anyone have an idea why this is happening?

Thank you in advance,
Roman
-- 
View this message in context: http://www.nabble.com/XmlHttpRequest-and-OpenCms-Direct-Edit-tf2644797.html#a7383194
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list