hey response I am sending back to my Ajax.Request, however, the new window does not open... why? echo "<script type=\"text/javascript\"> window.open('' " . $url . " '', ''popper'', ''scrollbars=no,width=900,height=300''); </script>"; die("There was an error."); it gets the "There was an error" text and inserts it into the page where I tell it to, but a new window does not open. how can i fix this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Looks like you must have a PHP error then. If not, you wouldn''t be getting that text. Best, Tobie On Jan 4, 3:20 am, ahs10 <quietaw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hey response I am sending back to my Ajax.Request, however, the new > window does not open... why? > > echo "<script type=\"text/javascript\"> > window.open('' " . $url . " '', ''popper'', > ''scrollbars=no,width=900,height=300''); > </script>"; > die("There was an error."); > > it gets the "There was an error" text and inserts it into the page > where I tell it to, but a new window does not open. how can i fix > this?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
No, that "die" statement is unconditional and will run no matter what. Your window is not opening because your browser is suppressing it. Modern browsers do not (by default) allow JavaScript to spawn a new window unless it''s the result of an explicit user action (e.g., a click). This was the antidote to the pop-up plague that infected the internet several years ago. Cheers, Andrew On Jan 3, 8:50 pm, Tobie Langel <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Looks like you must have a PHP error then. > > If not, you wouldn''t be getting that text. > > Best, > > Tobie > > On Jan 4, 3:20 am, ahs10 <quietaw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > hey response I am sending back to my Ajax.Request, however, the new > > window does not open... why? > > > echo "<script type=\"text/javascript\"> > > window.open('' " . $url . " '', ''popper'', > > ''scrollbars=no,width=900,height=300''); > > </script>"; > > die("There was an error."); > > > it gets the "There was an error" text and inserts it into the page > > where I tell it to, but a new window does not open. how can i fix > > this?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
It might be the case that the problem is not the popup window, but rather the js code itself. I have the same problem when I send back mixed HTML and JavaScript to an Ajax.Request - in Firefox it es executed properly, but in IE nothing happens. This has driven me crazy more than once and the only solution I''ve come up with is to send some HTML back with an event trigger, like e.g. <DIV onclick="Here''s the JS code">Something</DIV>. I wasn''t able to send back an Event.Observe - that also only worked in Firefox. Any other solution, anyone? On Jan 4, 7:53 am, Andrew Dupont <goo...-TiabPMV39B5K4mp1Ns0Z8Q@public.gmane.org> wrote:> No, that "die" statement is unconditional and will run no matter what. > > Your window is not opening because your browser is suppressing it. > Modern browsers do not (by default) allow JavaScript to spawn a new > window unless it''s the result of an explicit user action (e.g., a > click). This was the antidote to the pop-up plague that infected the > internet several years ago. > > Cheers, > Andrew > > On Jan 3, 8:50 pm, Tobie Langel <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > Looks like you must have a PHP error then. > > > If not, you wouldn''t be getting that text. > > > Best, > > > Tobie > > > On Jan 4, 3:20 am, ahs10 <quietaw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > hey response I am sending back to my Ajax.Request, however, the new > > > window does not open... why? > > > > echo "<script type=\"text/javascript\"> > > > window.open('' " . $url . " '', ''popper'', > > > ''scrollbars=no,width=900,height=300''); > > > </script>"; > > > die("There was an error."); > > > > it gets the "There was an error" text and inserts it into the page > > > where I tell it to, but a new window does not open. how can i fix > > > this?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
to confirm, there is no error with the php of the page, i''ve run it directly and it works just fine. i believe the person who suggested the browser is suppressing the new window is correct. so i have a work around in mind, i could open the new window client side after it evaluates the responseText of the Ajax.Request, but this brings about a new problem. can i assign a variable in the responseText? something to the effect of... (client side, in the javascript) if (transport.responseText.myVar == "error") { window.open('' " . $url . " '', ''popper'', ''scrollbars=no,width=900,height=300''); } else { alert(''There was no error!''); } On Jan 4, 5:03 am, Mickster <micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It might be the case that the problem is not the popup window, but > rather the js code itself. > I have the same problem when I send back mixed HTML and JavaScript to > an Ajax.Request - in Firefox it es executed properly, but in IE > nothing happens. > This has driven me crazy more than once and the only solution I''ve > come up with is to send some HTML back with an event trigger, like > e.g. <DIV onclick="Here''s the JS code">Something</DIV>. > I wasn''t able to send back an Event.Observe - that also only worked in > Firefox. > > Any other solution, anyone? > > On Jan 4, 7:53 am, Andrew Dupont <goo...-TiabPMV39B5K4mp1Ns0Z8Q@public.gmane.org> wrote: > > > No, that "die" statement is unconditional and will run no matter what. > > > Your window is not opening because your browser is suppressing it. > > Modern browsers do not (by default) allow JavaScript to spawn a new > > window unless it''s the result of an explicit user action (e.g., a > > click). This was the antidote to the pop-up plague that infected the > > internet several years ago. > > > Cheers, > > Andrew > > > On Jan 3, 8:50 pm, Tobie Langel <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > Looks like you must have a PHP error then. > > > > If not, you wouldn''t be getting that text. > > > > Best, > > > > Tobie > > > > On Jan 4, 3:20 am, ahs10 <quietaw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > hey response I am sending back to my Ajax.Request, however, the new > > > > window does not open... why? > > > > > echo "<script type=\"text/javascript\"> > > > > window.open('' " . $url . " '', ''popper'', > > > > ''scrollbars=no,width=900,height=300''); > > > > </script>"; > > > > die("There was an error."); > > > > > it gets the "There was an error" text and inserts it into the page > > > > where I tell it to, but a new window does not open. how can i fix > > > > this?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Ooops, sorry about that.> No, that "die" statement is unconditional and will run no matter what.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---