[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Popup Window Problem AJAX

Mark Dodwell

12/15/2006 9:36:00 PM

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-....

8 Answers

James Britt

12/15/2006 9:52:00 PM

0

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

You might do better to ask JavaScript questions on a JavaScript mailing
list.


--
James Britt

http://beginni... - Beginning Ruby: The Online Book
http://www.artima.c... - The Journal By & For Rubyists
http://www.rub... - The Ruby Store for Ruby Stuff

RubyTalk@gmail.com

12/15/2006 11:09:00 PM

0

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-....
>
>

Mark Dodwell

12/15/2006 11:16:00 PM

0

Thanks, but that doesn't help.

Is it something to do with a security issue that popup windows can't
make Ajax requests maybe? This is really annoying me!

Ta, Mark

--
Posted via http://www.ruby-....

RubyTalk@gmail.com

12/16/2006 8:21:00 PM

0

If it works after you refresh the popup window then its not a security issue.

If you pull the ajax call out of the form observer, does it send a
message to the server when the page loads?

Sbecker

On 12/15/06, Mark Dodwell <seo@mkdynamic.co.uk> wrote:
> Thanks, but that doesn't help.
>
> Is it something to do with a security issue that popup windows can't
> make Ajax requests maybe? This is really annoying me!
>
> Ta, Mark
>
> --
> Posted via http://www.ruby-....
>
>

Steve de Mena

5/19/2012 7:39:00 AM

0

On 5/18/12 8:18 PM, Art wrote:


> As nifty as that all is, I'm way too lazy to use it so my preferred
> method is a Sharpie and my very illegible, left handed, penmanship.

Hear Hear!

+1 for a Sharpie. :)

Steve

John Hood

5/19/2012 7:43:00 AM

0

They don't look as good as the results of CD printers.

JH

"Steve de Mena" <steve@demena.com> wrote in message
news:q-OdnVZr2PiU0yrSnZ2dnUVZ_s6dnZ2d@giganews.com...
> On 5/18/12 8:18 PM, Art wrote:
>
>
>> As nifty as that all is, I'm way too lazy to use it so my preferred
>> method is a Sharpie and my very illegible, left handed, penmanship.
>
> Hear Hear!
>
> +1 for a Sharpie. :)
>
> Steve
>

wkasimer

5/19/2012 1:24:00 PM

0

On May 19, 3:43 am, "John Hood" <johnh...@iinet.net.au> wrote:

> They don't look as good as the results of CD printers.

But they look just as good while they're playing....

Bill

John Hood

5/19/2012 1:50:00 PM

0

You must have a transparent CD player and great eyesight.

"wkasimer" <wkasimer@comcast.net> wrote in message
news:429596a4-143e-40ab-81bf-26387f84834a@t23g2000yqj.googlegroups.com...
> On May 19, 3:43 am, "John Hood" <johnh...@iinet.net.au> wrote:
>
>> They don't look as good as the results of CD printers.
>
> But they look just as good while they're playing....
>
> Bill