可以在 View 中从其网址呈现外部网页吗?我正在使用带 Handlebars 的主干。
var AuthorizeInstagramView = Backbone.View.extend({
template: Handlebars.compile(template),
initialize: function () {
},
render:function(){
RENDER WEBPAGE FROM ITS URL
},
});
return AuthorizeInstagramView;
});
我怎样才能做到这一点?
最佳答案
为什么不进行AJAX调用并输出响应内容呢?喜欢
render: function() {
// Render the template here..
// Then make the AJAX call and output the response content.
$.ajax({
url: url,
type: 'GET'
}).done(function(response) {
$("#content").html(response)
});
}
关于javascript - 在 Backbone 中渲染外部网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23611344/