Generate shortcode with Ajax
-
Hey. I want to load the map only after I click on a button ( run an Ajax call that will do a shortcode and return me container with all the data – see lower ) and this generate me a container with these attributes.
<div id="wpgmza_map" class="wpgmza_map" data-settings="{data...}" data-map-id="id" data-maps-engine="open-layers" data-shortcode-attributes="{attributes}" style="display:block; overflow:auto; width:100%; height:400px; float:left;"></div>
I don’t know what scripts I must run after I generate my container with all the data, there is a hook that I can use it, or a JS script ( method ) that call all the required css and js files that I need based on the data-map object and the rest of attributes?
I want to do it in this way because I don’t want to laod on each page the map, only if a user want it and I want to do it with Ajax.
- The topic ‘Generate shortcode with Ajax’ is closed to new replies.