且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在返回Ajax调用需要一个javascript函数

更新时间:2023-11-24 11:02:34

我可以问你为什么需要从服务器返回的JavaScript?你怎么样从服务器返回一个简单的回应(字符​​串,布尔,数字),并执行一些基于返回值已经住在客户端上?更安全,更容易。它可能不是你正在寻找的解决方案,但你的JS福将它强多了。

Can I ask why you need to return JavaScript from the server? How about you return a simple response (string, boolean, number) from the server, and execute something that already lives on the client based on the return value? Much safer and easier. It may not be the solution you are looking for, but your js-fu will be much stronger for it.