I have a form in a struts 2 webapp. I have the jquery plugin plugin working nicely. However on some of my pages I am reloading div's depending on user interaction and am using the following javascript to submit actions and reload divs on the page :
function doWhatever()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("mydiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","MyAction.action?id="+1);
xmlhttp.send();
}
This all works fine, except when I reload the div with the result of the action, none of the jquery tags render correctly on the new page within the div. The regular struts s: tags do render correctly on the new page within the div On the new inner page I have included the same tags as on the main page :
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sjq" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head />
</head>
Any help on this would be appreciated.
Struts 2 version 2.3.16.3 struts 2 jquery plugin version : 3.7.1
Spunog