Ok, here's what I ended up doing and I think it works.
I have this getting loaded in my "main" page.
<pre>
function sethtml(div,content)
{
var search = content;
var script;
while( script = search.match(/(<script[^>]+javascript[^>]+>\s*
(<!--)?)/i))
{
search = search.substr(search.indexOf(RegExp.$1) + RegExp.
$1.length);
if (!(endscript = search.match(/((-->)?\s*<\/script>)/))) break;
block = search.substr(0, search.indexOf(RegExp.$1));
search = search.substring(block.length + RegExp.$1.length);
var oScript = document.createElement('script');
oScript.text = block;
document.getElementsByTagName("head").item(0).appendChild
(oScript);
}
document.getElementById(div).innerHTML=content;
}
</pre>
/* I'm not clever enough to write this, found it here:
http://www.modernmethod.com/sajax/forum/viewtopic.php?t=847 */
In my ajaxlink I have a callback on completion to sethtml like this:
<pre>
$this->Ajax->link($text, $opts, array('update' =>
$update."Data",
'complete' => "sethtml('".$update."Data',request)",
)
);
</pre>
Through trial and error I found that request contains the content
returned from the Ajax call.
It seems to work!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---