try not to use .live its deprecated and a pointer to .on() !
–
EvilPMar 1 '12 at 10:54

@EvilP: As others said to you last time, only in 1.7 and up. A lot of projects will still be on 1.5 or 1.6.
–
T.J. CrowderMar 1 '12 at 11:02

4

Downvoter: Just because you don't like popups, that doesn't mean this question should be downvoted. A question should be downvoted if it "...does not show any research effort; if is unclear or not useful". The question is clear, doesn't seem lazy, and stems from a non-trivial combination of factors.
–
T.J. CrowderMar 1 '12 at 11:03

@T.J.Crowder: He didn't specify which version he is using. So I should consider that he is using the latest version. If he is using a different version, I'm sure he would mention that because THEN he WOULD be aware of the fact that live is deprecated and would explain WHY he is using .live(). Nobody ever told me the "last" time so I thing you should get yourself a break and calm down. There is no need to be so harsh...
–
EvilPMar 1 '12 at 11:16

Didn't got any notification about that. But isn't it normal to consider that if somebody doesn't specify their version to consider that they are using the latest ? I mean I have to use 1.3 for a reason and I'm aware of the fact that there is a newer and better version.
–
EvilPMar 1 '12 at 11:20

3 Answers
3

Popup blockers will typically only allow window.open if used during the processing of a user event (like a click). In your case, you're calling window.openlater, not during the event, because $.getJSON is asynchronous.

You have two options:

Do something else, rather than window.open.

Make the ajax call synchronous, which is something you should normally avoid like the plague as it locks up the UI of the browser. $.getJSON is equivalent to:

Thanks a million. Your suggestion of making call synchronous worked like a charm. The same did help me in my probable next issue of handling navigation on dialogue's OK event.
–
mavazeMar 2 '12 at 7:36

As T.J. Crowder has left 2 questions open, [1. find alternative to window.open] and [2. avoid ajax synchronous call] suggestions on those are welcome for benefit of the community. Else I found his answer a perfect solution for the said question :)
–
mavazeMar 2 '12 at 7:47

2

For me, I added a link with target="_blank" to prompt the user to click.
–
hiroshiApr 20 '12 at 7:14

In the upcoming jQuery 1.8, the synchronous functionality is being deprecated. Any ideas how to make this work without that?
–
EvanJun 25 '12 at 3:06

This doesn't work on Safari Mobile (tested on IPhone 4). I tried several other ideas (e.g. myWindow.postMessage) but because of Safaris restriction of not executing JavaScript in the background, the parent window can never send that location change.
–
BausTheBigMay 14 '14 at 0:28

@BausTheBig I tested on IPhone 6, IOS8. It worked like a charm.
–
LVarayutJan 24 at 13:44

The observation that the event had to be initiated by the user helped me to figure out the first part of this, but even after that Chrome and Firefox still blocked the new window. The second part was adding target="_blank" to the link, which was mentioned in one comment.

In summary: you need to call window.open from an event initiated by the user, in this case clicking on a link, and that link needs to have target="_blank".