English 中文(简体)
Java字功能在不等待上述职能的情况下执行?
原标题:Javascript functions execute without waiting for functions in the lines above to return?

我将一项职能约束在提交纽顿时。 我希望这一功能能够播下一只方言盒,等待用户的互动,而N提交表格(通过一个jax员额)。

但是,我看到的行为是,方言波浪,但该功能仍在继续执行,而且阿加克斯员额确实如此,尽管方言盒中点击 t了。 我需要某种方式来停止执行,直到该方言功能返回。

我有这样的想法:

submitForm: function () {   

        <call a function that pops up a dialog, doesn t return until user interacts> 

        new Ajax.Updater( dialogContainer , url, {
                ...........
            }
        });      

        return false;
    }

我认为,这是 Java文的预期行为,但并不肯定如何绕过它......

最佳回答

浏览器的 Java稿将依次执行,因此,显然,你呼吁启动iframe dialog 箱doesn t,等待用户的交流和安乐;立即返回。 我的猜测是,如果你重新使用广播方言箱的图书馆,它会以用户行动为基础,发挥某种阻扰作用。 因此,你只需要将<条码>新Ajax.Updater(......);代码改为背书功能。

问题回答

根据我掌握的 j印的基本知识,我认为,只要辩证箱独立于你的代码(称为《法典》),就算出正常的行为。

贵国的方言箱是否有 j子。 因为我认为,如果存在的话,你可能会通过直径(执行你想要的密码的召回)的功能,在对话箱返回时,这种功能将被叫去。

I would say that you should call the first function also through ajax. and I think you are using prototype.

You have onComplete callback function in Ajax.Request and Ajax.Updater Objects. Then in onComplete function can run the second function.

喜欢

onComplete : function() { new Ajax.Updater( dialogContainer , url, { ........... } }); }

如果你的网络客户只是互联网探索者,你就可以使用窗口。 Dialog。 它在母窗的窗户里有阻塞 j的冰层。

Modal 气象局已经实施,但我不知道该功能是否在 Firefox受阻。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签