Javascript弹出窗口问题 [英] Javascript popup window question

查看:76
本文介绍了Javascript弹出窗口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部,


我正在使用javascript(window.open())创建一个弹出窗口来进行一些处理。这个弹出窗口将创建一个PDF,可能需要10秒到2分钟(很多后端SQL调用),我希望使用这个弹出窗口向用户显示正在进行的操作(动画gif)并给他们能够使用父窗口在我们的系统中做其他事情(弹出窗口是在服务器上创建PDF)。


我的问题在于弹出窗口正在创建在PDF中,父窗口无法导航到其他页面(直到弹出窗口完成)。有没有办法取消弹出窗口与父窗口的关联,以便用户能够在弹出窗口处理时使用父窗口导航?


Thx

jonpfl

All,

I am using javascript (window.open()) to create a popup to do some processing. This popup is going to create a PDF which can take anywhere from 10 secs to 2 mins (alot of backend SQL calls) and I was hoping to use this popup to show the user that something is going on (animated gif) and give them the ability to use the parent window to do other things in our system (while the popup is creating the PDF on the server).

My problem lies in the fact that while the popup is creating the PDF, the parent window cannot navigate to other pages (until the popup window is done). Is there any way to disassociate the popup window with the parent window so a user will be able to navigate with the parent window while the popup window is processing?

Thx
jonpfl

推荐答案

你可以发送一个AJAX调用,只需在服务器发送响应时打开窗口...这是在onreadystatechange-callback中完成的 - 首先看一下基本的AJAX示例,并在有它们时询问更多关于它的问题:)


亲切的问候
you could send an AJAX-call and just open the window when the server sends the response ... this is done in the onreadystatechange-callback - first just have a look at a basic AJAX-example and ask more questions about it when you have them :)

kind regards


I之前从未使用过ajax。


有没有办法只使用javascript或者我必须得到ajax?


Thx

jonpfl
I have never used ajax before.

Is there a way to do with just javascript or am I going to have to get ajax?

Thx
jonpfl


AJAX只是javascript;)...通过利用浏览器XMLHttpRequest及其异步行为......用你可以实现你的目标想要...


亲切的问候
AJAX is just javascript ;) ... by making use of the browsers XMLHttpRequest and its asynchronous behaviour ... with that you could achieve what you want ...

kind regards


这篇关于Javascript弹出窗口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆