Same browser in the same configuration each time, and you're certain you're not pulling any cached files in either one?
The folder structure is identical too? If you have your domain pointed to one folder and the other one you're accessing via IP, there might be a broken file path somewhere. Do you call the function using the domain name in the href, or do you return to the root folder? If so, this might be the cause. You may need to make your path relative until the domain name gets switched, or call it via IP in your markup.