window.location picks IP address and not the domain name

寵の児 提交于 2019-12-13 03:44:50

问题


I've my ruby on rails website registered as a subdomain under 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.

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

Can anyone help ?


回答1:


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.



来源:https://stackoverflow.com/questions/24364809/window-location-picks-ip-address-and-not-the-domain-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!