小编Ade*_*del的帖子

是否有受支持的CodePlex许可证限制使用商业来源?

我一直在阅读CodePlex支持的开源许可证,我无法理解一切,我正在寻找的是一个限制我的源代码商业使用的许可证.

有吗?

谢谢

licensing open-source codeplex

10
推荐指数
1
解决办法
2122
查看次数

如何从函数外部的JSONP调用返回结果?

我有以下功能很好,我使用JSONP来克服跨域,写了一个http模块来改变内容类型,并没有在url中追加一个回调名称.

function AddSecurityCode(securityCode, token) {
var res=0;
$.ajax({ url: "http://localhost:4000/External.asmx/AddSecurityCode",
    data: { securityCode: JSON.stringify(securityCode),
        token: JSON.stringify(token)
    },
    dataType: "jsonp",
    success: function(json) {
        alert(json); //Alerts the result correctly
        res = json;
    },
    error: function() {
        alert("Hit error fn!");
    }
});
return res; //this is return before the success function? not sure.
Run Code Online (Sandbox Code Playgroud)

}

res变量是alwayes未定义.而且我不能在jsonp中使用async = false.那么如何才能将结果返回到函数外部?我肯定需要为次要的电话做这件事.

请指教,谢谢.问题是我无法在此函数之外返回结果值

javascript ajax jquery json jsonp

2
推荐指数
1
解决办法
1763
查看次数

标签 统计

ajax ×1

codeplex ×1

javascript ×1

jquery ×1

json ×1

jsonp ×1

licensing ×1

open-source ×1