JS Code Editor

Users of WP Maps have the ability to use JS codes to change or modify certain elements of their product or store locator widgets.

For example, WP Maps users can replace the default contact form with a HubSpot contact form using the JS code editor. Furthermore, any platform’ contact form can be added by using the JS code editor.WP Maps users can use the below functions (or methods) to bind and create different events:

  1. toggleClass(selector, myClass)hasClass(selector, myClass)removeClass(selector, myClass, _doc)addClass(selector, myClass, _doc)display(_ele, _style)deleteElement(_node)addEvent(_selector, _cb, _scope, _event_type)emptyElement(_node)createElement(_element, _attributes, _inner)alert(_message, _type, _cont)

To access the JS Editor, please follow the below steps:

  1. Log into your WP Maps account and click on the “Widgets” tabGo to the “builds” section, press “Options” on a build you wish to modify and select “Customize”

image (3).png

  1. On the “Template Customizer” page, select the element you wish to modify using the “Template Section” drop-down menuPress the “JS Code” button to open the JS editor to modify the template you have chosen

image (4).png

  1. Enter the JS codePress “Save Code” when you are done


  1. Head back to the “Widgets” page and refresh the build by pressing “Update”

Once you have updated the build, you can preview the product or store locator widget to verify if the changes have been made.In the below images, we have changed the default WP Maps lead form to a lead from by Hubspot.image (1).pngimage (2).png 

For any questions or concerns, please feel free to reach us at [email protected]