简体   繁体   English

从后端JavaScript引发警报

[英]Raising alerts from backend javascript

I'm building an app with Meteor and Meteoric (integration with Ionic, which replaces the angular with blaze). 我正在使用Meteor和Meteoric(与Ionic集成,将火焰替换为角度)构建了一个应用程序。 I have a method running on server which I want it to popup alert for the user if some condition is met, but of course I can't do so because Ionic is a client side framework. 我有一个在服务器上运行的方法,如果满足某些条件,我希望它为用户弹出警报,但是我不能这样做,因为Ionic是客户端框架。

I tried to return a variable to the place in client where I call the method and make it raise the popup but it just ignores it. 我试图将变量返回到客户端中我调用该方法的位置,并使它引发弹出窗口,但是它只是忽略了它。 (Maybe because I can't really do it between client and server?) (也许是因为我不能在客户端和服务器之间真正做到这一点?)

Anyone has a suggestion for this? 有人对此有建议吗?

You could make a request from the client to the server, and depending on the response on the client you can alert (or continue if for example nothing went wrong). 您可以从客户端向服务器发出请求,然后可以根据客户端的响应来发出警报(如果没有问题,请继续操作)。 What did you try already? 您已经尝试了什么? And what is the method doing? 该方法在做什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM