问题
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