Title: Javascript into editor
Last modified: October 31, 2016

---

# Javascript into editor

 *  Resolved [jimhags](https://wordpress.org/support/users/jimhags/)
 * (@jimhags)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/javascript-into-editor/)
 * Is there way to disable formatting so that I can put javascript for a hubspot
   form in the editor?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/javascript-into-editor/#post-8380122)
 * When editing a box there should be a choice in the right top corner of the editor
   for “visual” or “text”. If you click on “text” you can add HTML and JavaScript
   code.
 *  Thread Starter [jimhags](https://wordpress.org/support/users/jimhags/)
 * (@jimhags)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/javascript-into-editor/#post-8380957)
 * I thought the problem was the JavaScript, but it is actually that the hubspot
   form script is firing when the page loads, embedding the form at the bottom of
   the site, and not inside the box (which is fired at 65% scroll). Is there a way
   to keep the script from loading until the box loads?
 *  Plugin Author [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/javascript-into-editor/#post-8395530)
 * Hi Jim,
 * We’ve just added this short article on [Boxzilla’s JavaScript events](https://kb.boxzillaplugin.com/javascript-events/)
   to our knowledge base.
 * Basically what you want to do is use the **Boxzilla.on(event, callback)** function
   to delay your function execution until a certain event fires.
 *     ```
       <script>
       Boxzilla.on('box.show', function(box) {
          // your hubspot code goes here
       });
       </script>
       ```
   
 * Hope that helps!
 *  Thread Starter [jimhags](https://wordpress.org/support/users/jimhags/)
 * (@jimhags)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/javascript-into-editor/#post-8411401)
 * I couldn’t get it to inject the hubspot code into a div in the box. I think if
   the editor had a raw html mode it may work. I ended up putting in a custom form
   and doing an API call to Hubspot.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Javascript into editor’ is closed to new replies.

 * ![](https://ps.w.org/boxzilla/assets/icon-256x256.png?rev=1414640)
 * [Boxzilla - WordPress Popup Builder](https://wordpress.org/plugins/boxzilla/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/boxzilla/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/boxzilla/)
 * [Active Topics](https://wordpress.org/support/plugin/boxzilla/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/boxzilla/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/boxzilla/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [jimhags](https://wordpress.org/support/users/jimhags/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/javascript-into-editor/#post-8411401)
 * Status: resolved