CMS Development

chrissa0000
Contributor

Some of Javascripts function won't run when imported in Hubspot

SOLVE

Hello, I have full calendar embedded in one of the hubspot pages http://info.besocialscene.com/events. Before I added it in Hubspot I tried to run in locally and it went smoothly but when I tried to add it here in Hubspot some of the javascript functions such as when you click an event you can see the details below. But it  wont work here in Hubspot. I tried to check the view source and all of the necesarry libraries was there I use cndjs link to run the fullcalendar, jquery and moment.js files.

 

Hope you could help me.

 

 

0 Upvotes
1 Accepted solution
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Some of Javascripts function won't run when imported in Hubspot

SOLVE

The JS appears to be running fine. You are just missing the results table element in your page. When I add the following JS to console, clicking on the event ends up working: 

 

$('body').append('<div class="order-details-table"></div>');

So, to fix your issue.... Just add an html block with the element into your page wherever you want the click results to appear. Just add the following html to your page:

 

<div class="order-details-table">&nbsp;</div>

 


tim@belch.io | https://forms.belch.io


If this answer helped, please, mark it as solved 😄

View solution in original post

0 Upvotes
3 Replies 3
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Some of Javascripts function won't run when imported in Hubspot

SOLVE

The JS appears to be running fine. You are just missing the results table element in your page. When I add the following JS to console, clicking on the event ends up working: 

 

$('body').append('<div class="order-details-table"></div>');

So, to fix your issue.... Just add an html block with the element into your page wherever you want the click results to appear. Just add the following html to your page:

 

<div class="order-details-table">&nbsp;</div>

 


tim@belch.io | https://forms.belch.io


If this answer helped, please, mark it as solved 😄
0 Upvotes
chrissa0000
Contributor

Some of Javascripts function won't run when imported in Hubspot

SOLVE

I tried to add the following codes, but when I tried to save it only the above line will appear 

<div id='calendar'></div>

<div class="event-list">
<div class="event-description-section">
<table class="table order-details-table">
<tbody id="insert_here">

</tbody>
</table>
</div>
</div>

0 Upvotes
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Some of Javascripts function won't run when imported in Hubspot

SOLVE

The only thing I see different about that first line is that it's using single quotes instead of double quotes. Are you adding this to the source view of a wysiwyg?

0 Upvotes