window.location选择IP地址而不是域名 [英] window.location picks IP address and not the domain name

查看:520
本文介绍了window.location选择IP地址而不是域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Rails网站上将红宝石注册为godaddy.com下的子域

I've my ruby on rails website registered as a subdomain under godaddy.com

工作正常.但是,当我尝试获取window.location.host时,它将返回服务器的IP地址而不是域名.

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.

因此,我的Google Picker JS API出现以下错误:

Because of this I'm getting the following error with my google picker js api:

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

任何人都可以帮助吗?

推荐答案

这是因为可能会将域设置为域转发模式.域实际上需要指向与域转发不同的IP.

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.

这篇关于window.location选择IP地址而不是域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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