我查看了这里的文档:http://bluebirdjs.com/docs/api/promise.resolve.html
我看到了这句话:"如果value不是 thenable ,则返回已履行的Promise,其值为其履行值"。
我的问题是什么是可靠的价值。例如,我看到了以下代码:
$('#alert_div')
.attr("title", "Delete all instances?")
.text("Are you sure you want to delete all instances of this event between the specificed dates? This cannot be undone.")
.dialog({
modal: true,
draggable: false,
position: { my: "top", at: "center", of: window },
buttons: [
{
text: "No",
icons: { primary: "ui-icon-check" },
click: function() {
$(this).dialog('close');
console.log('Clicked no.');
}
},
{
text: "Yes",
click: function () {
$(this).dialog('close');
console.log('Clicked yes');
}
}
]
});
这种情况下的值是一个HTTP地址字符串。什么是可用的HTTP地址?
我不会问承诺和可能的对象之间有什么区别。我的问题是如何知道字符串是否可用。