Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个事件处理程序,用于在 Plupload 中引发错误时:
Error: function(up, args) { // do something }
如何在代码的其他地方引发错误?我想说up.RaiseError("something is wrong etc")。
up.RaiseError("something is wrong etc")
您可以手动触发错误事件:
up.trigger('Error', args);
whereargs基本上可以是你想要的任何东西。为了一致性,args应该是一个具有 2 个必需键code和message,以及 2 个可选键file和的对象status。
args
code
message
file
status