Embedding in hubspot

lmvalenzuela

New member
I'm trying to embed in a Hubspot html+hubl page, and just by adding the js files, I'm starting to get problems in the console:

Code:
SyntaxError: missing : after property idimagerotator.min.js:1:622

I have control over head's files loaded by the page, and for now, the only files I've been downloading to the page are:
basic.css: https://cdn2.hubspot.net/hub/6860826/hub_generated/template_assets/28440116902/1587056131407/TRUVAC_March2020_Theme/360/Prodigy/imagerotator/html/css/basic.min.css
jquery-3.4.1.min.min.js: https://cdn2.hubspot.net/hub/6860826/hub_generated/template_assets/28440170370/1587056153868/TRUVAC_March2020_Theme/360/Prodigy/imagerotator/html/js/jquery-3.4.1.min.min.js
and

https://cdn2.hubspot.net/hub/6860826/hub_generated/template_assets/28440116906/1587056133269/TRUVAC_March2020_Theme/360/Prodigy/imagerotator/html/js/imagerotator.min.js

The code of the page:

Code:
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{{ content.html_title }}</title>
    <meta name="description" content="{{ content.meta_description }}">
    {{ standard_header_includes |cut('https://static.hsappstatic.net/jquery-libs/static-1.1/jquery/jquery-1.7.1.js') }}
    <link type="text/css" rel="stylesheet" href="{{ get_asset_url('/TRUVAC_March2020 Theme/360/Prodigy/imagerotator/html/css/basic.css') }}"/>
    <script type="text/javascript" src="{{ get_asset_url('/TRUVAC_March2020 Theme/360/Prodigy/imagerotator/html/js/jquery-3.4.1.min.js') }}"></script>
    <script type="text/javascript" src="{{ get_asset_url('/TRUVAC_March2020 Theme/360/Prodigy/imagerotator/html/js/imagerotator.js') }}"></script>
  </head>
  <body>
    
    {{ standard_footer_includes |cut('https://static.hsappstatic.net/HubspotToolsMenu/static-1.62/js/index.js') }}
  </body>
</html>
 

WebSupport

Active member
Any chance you could test without some get_asset_url which is may be causing it?

And also please remove jQuery 1.7.1 as you load another version (a good newer one) down below.
 

lmvalenzuela

New member
Jquery 1.7.1 is being removed the urls listed just below the code are the ones being resolved and loaded with a 200 status. The only 3 things that are now on the page are the ones being listed.
You can check on the console on the following link:

[link-removed]
 

WebSupport

Active member
Great! I think you are almost there. It currently can't find this image:

/hubfs/TRUVAC_March2020/360/Prodigy/images/Prodigy_360_11.19_Curb.jpg?t=1575918443

If I try to open it directly in my browser, it comes back with 404.
 

lmvalenzuela

New member
It seems that hubspot is making some weird stuff when uploading to the CDN, so I put some of the files on other hosting. Seems working. I'll put the assets inside hubspot, but as you might guess there are a lot !
 

lmvalenzuela

New member
Ok, here was what I had to do. To avoid CORS errors, all the assets are being stored inside hubspot.
Next thing, js, css and jquery have to live outside hubspot in order to work.
If someone has a similar problem, and has any doubts please, don't hesitate in contact me.

Thanks @WebSupport for the clues and the help !
 

WebSupport

Active member
Interesting! Thanks so much for the update :)

PS: to avoid CORS errors for the 360 assets, you may also consider our optimized hosting that is configured to allow cross domain asset loading: https://www.webrotate360.com/services/pixriot.aspx
 
Top