简体   繁体   English

window.location选择IP地址而不是域名

[英]window.location picks IP address and not the domain name

I've my ruby on rails website registered as a subdomain under godaddy.com 我在Rails网站上将红宝石注册为godaddy.com下的子域

It works fine. 工作正常。 But when I try to get the window.location.host, It returns the IP address of my server and not the domain name. 但是,当我尝试获取window.location.host时,它将返回服务器的IP地址而不是域名。

Because of this I'm getting the following error with my google picker js api: 因此,我的Google Picker JS API出现以下错误:

    Incorrect origin value. Please set it to - (window.location.protocol + '//' + window.location.host) of the top-most page

Can anyone help ? 有人可以帮忙吗?

This is because the domain might be set in domain forwarding mode. 这是因为可能将域设置为域转发模式。 The domain needs to actually point to the IP which is different than domain forwarding. 域实际上需要指向与域转发不同的IP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM