如何在excel文件导出后调用jquery函数而不是成功方法? [英] How to call jquery function after excel file export not on success method?

查看:109
本文介绍了如何在excel文件导出后调用jquery函数而不是成功方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在mvc动作文件返回后调用jquery ...



我尝试过:



i want to call jquery after function when mvc action file return..

What I have tried:

i want to call jquery after function when mvc action file return..





喜欢这个



like this

$("[data-ajax-update*='partial']").after(function () {}

推荐答案

([data-ajax-update * ='partial'])。after(function(){}
("[data-ajax-update*='partial']").after(function () {}


你不能,因为一个请求只能有一个响应,如果你想要一个文件下载然后响应必须是文件,如果你想要javascript执行然后响应必须是html \ _javascript。响应不能同时是这两种情况。



如果你谷歌如何在文件下载上运行javascript你会发现各种技巧和黑客来获得这种工作,例如在用于执行文件下载的页面上有一个像素隐藏的iframe,这样你就可以运行一些javascript。



另外只是要清楚文件下载后无法执行js,客户端不知道文件是否已下载完全没有。
You can't because a request can only have one response, if you want a file to be downloaded then the response has to be the file, if you want javascript to execute then the response has to be html\javascript. The response can't be both of those things.

If you google for how to run javascript on file download you'll find various tricks and hacks to get this kind-of working, such as having a 1 pixel hidden iframe on the page that you use to do the file download so you can then run some javascript.

Also just to be clear there is no way of executing js after the file has been downloaded, the client has no idea if the file has been downloaded at all.


这篇关于如何在excel文件导出后调用jquery函数而不是成功方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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