Java script not appearingSOLVE
Jun 8, 2017 7:49 AM
I have some java script that embeds a web service application. The application shows up fine in WordPress but does not show up on HubSpot pages.
In fact, when I save changes and update the page, the code is not there at all when I inspect the page. I also tried to add/save a HTML footer with the code, but the same thing happens - the code is not there after I save my changes and return to the advanced settings.
Does HubSpot need something added/modified in the code to display java script?
Solved! Go to Solution.
Jun 8, 2017 11:41 AM
You're getting quite a few errors relating to insecure connections. Is that the exact code from the Wordpress site as well? I tried to both clone your page as well as run the code in a codepen and I get the same errors.
I took a look at the files you're linking to and I believe you are just experiencing a problem with Same-Origin policy. Whenever you try to pull 'http' files onto an 'https' site, the browser will block the request as it's a security issue.
Some things you can try to fix this:
1. Store all the files and urls on an 'https' site
2. Hardcode this in as a custom module
3. Try to iframe in that page as an alternative
Same-origin is nice as it prevents scripting attacks and such, but it's such a buzz kill when trying to get things to work. If none of those above work, if you want to pull http files onto an https site, you will need to do so using AJAX requests.You can read more about Same-Origin here.
Hope this helps!