我需要以同步方式进行三次HTTP调用,如何将数据从一个调用传递到另一个调用?
function first()
{
ajax()
}
function second()
{
ajax()
}
function third()
{
ajax()
}
function main()
{
first().then(second).then(third)
}
Run Code Online (Sandbox Code Playgroud)
我试图将延迟用于两个函数,我想出了一个部分解决方案.我可以将它扩展为三个功能吗?
function first() {
var deferred = $.Deferred();
$.ajax({
"success": function (resp)
{
deferred.resolve(resp);
},
});
return deferred.promise();
}
function second(foo) {
$.ajax({
"success": function (resp)
{
},
"error": function (resp)
{
}
});
}
first().then(function(foo){second(foo)})
Run Code Online (Sandbox Code Playgroud) 在Visual Studio 10 - Visual Basic中,为什么我的唯一引用是"系统"时无法导入"System.Drawing"?我可以导入"System.Runtime.InteropServices".
若要重现我的问题:
1.使用Visual Basic类库模板在Visual Studio 10中创建一个新项目.
2.在开头添加"Imports System.Drawing"和"Imports System.Runtime.InteropServices".
3.删除项目属性的"引用"窗格中除"系统"之外的所有引用.
结果:Visual Studio找不到"System.Drawing"但它可以找到"System.Runtime.InteropServices"."System.Drawing"是完全限定的,因此系统应该能够在引用的"系统"中找到它.
思考:看来"System"和"System.Drawing"是不同的命名空间(或容器?),所以为什么没有资格"." 工作?是"." 代表别的什么?
"System"也在"mscorlib"中,但是使用的命名空间还是另一个?
"Microsoft.VisualBasic"也列在导入的命名空间中,但没有对它的引用.怎么找到的?填充的"导入的命名空间"列表在哪里?
来自MSDN库的任何相关信息的链接肯定会有所帮助.我已经查看了一段时间,但无法理解为什么不导入"System.Drawing".
.net ×1
assemblies ×1
asynchronous ×1
deferred ×1
javascript ×1
jquery ×1
reference ×1
vb.net ×1