M
Mark Dodwell
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>
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>