Sorry I don't have time to mock this up and test my idea. Try moving
<script type="text/javascript">
//<![CDATA[
new Form.Element.Observer(
'search',
0.5, function(element, value) {
new Ajax.Updater(
'items',
'/admin/browser/items?item_type=ImageAsset', {
asynchronous: true,
evalScripts: true,
parameters: 'search=' + escape(value)
}
)
});
//]]>
below
<div id="items"></div>
Sbecker
On 12/15/06, Mark Dodwell <seo / mkdynamic.co.uk> wrote:
> When I try to use Ajax in a window openened by 'window.open('<url>');'
> it doesn't work. There is no exceptions raised as far as I can see
> (debugging with FireBug).
>
> However, if I refresh the window once it has popped up it does work. Is
> there something I'm missing?
>
> Code in my popup window:
> ------------------------------------------------------------
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title>Image Browser</title>
> <%= javascript_include_tag '/admin/javascripts/prototype.js' %>
> </head>
> <body>
> Search: <input type="text" id="search" name="search" />
>
> <script type="text/javascript">
> //<![CDATA[
> new Form.Element.Observer(
> 'search',
> 0.5, function(element, value) {
> new Ajax.Updater(
> 'items',
> '/admin/browser/items?item_type=ImageAsset', {
> asynchronous: true,
> evalScripts: true,
> parameters: 'search=' + escape(value)
> }
> )
> });
> //]]>
> </script>
>
> <div id="items"></div>
> </body>
> </html>
> ------------------------------------------------------------
>
> Many Thanks,
> Mark
>
> --
> Posted via http://www.ruby-forum.com/.
>
>