Backbone.js的HTTPS [英] backbone.js https

查看:95
本文介绍了Backbone.js的HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一上午的谷歌搜索,但无法找到答案。

Been googling all morning but can't find an answer.

有关的正式文件甚至没有单词HTTPS或SSL就可以了。

The official documentation does not even have the words "https" or "ssl" on it.

目前我有这样的:

var A = backbone.Collection.extend({
  url : "a"
});

有没有办法让网址HTTPS,而不使用绝对路径?

is there a way to make the url https, without using absolute path?

推荐答案

我不认为你可以将URL更改为HTTPS,因为它只是构建一个相对URL到你的位置。为什么不能做这样的事情:

I don't think you can change the URL to HTTPS since it's just building a relative URL to your location. Why not do something like this:

var A = Backbone.Collection.extend({
  url: function() {
    return "https://" + this.document.location.host + "/a";
  }
});

这篇关于Backbone.js的HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆