Title: [Plugin: Shortcodes Pro] Javascript?
Last modified: August 20, 2016

---

# [Plugin: Shortcodes Pro] Javascript?

 *  Resolved [noixdarec](https://wordpress.org/support/users/noixdarec/)
 * (@noixdarec)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-shortcodes-pro-javascript/)
 * Hi, does it work with Javascript? Trying to insert a Google Earth widget which
   uses javascript, after hit the “insert” says
 * > Shortcode not found. Please verify your settings
 * …
 * [http://wordpress.org/extend/plugins/shortcodes-pro/](http://wordpress.org/extend/plugins/shortcodes-pro/)

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

 *  Plugin Author [Matt](https://wordpress.org/support/users/sksmatt/)
 * (@sksmatt)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-shortcodes-pro-javascript/#post-2396258)
 * Hi Noixdarec,
 * It shouldn’t be a problem to use JavaScript. Would be great to see the code you
   are trying to insert, please send the link and I’ll check.
 * Kind Regards!
 *  Thread Starter [noixdarec](https://wordpress.org/support/users/noixdarec/)
 * (@noixdarec)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-shortcodes-pro-javascript/#post-2396259)
 * Thanks sksmatt, it feels always so good when you get the author’s direct reply.
 * I tasted it by embedding the [Google Earth widget](http://www.gmodules.com/ig/creator?url=http://code.google.com/apis/kml/embed/embedkmlgadget.xml&up_kml_url=&up_view_mode=earth&up_earth_2d_fallback=0&up_earth_fly_from_space=1&up_earth_show_nav_controls=1&up_earth_show_buildings=1&up_earth_show_terrain=1&up_earth_show_roads=1&up_earth_show_borders=1&up_earth_sphere=earth&up_maps_zoom_out=0&up_maps_default_type=map&synd=open&w=500&h=400&title=Embedded+KML+Viewer&border=%23ffffff|3px%2C1px+solid+%23999999)
   using javascript. If I don’t use attributes then it works like a charm, [see here](http://consommedartiste.hyperreel.net/?p=489).
   Otherwise it gives me that error message after clicking the custom insert button.(
   in this case I have no url to show you because I can’t insert anything to the
   post).
 * My settings are:
 * Behavior: Insert custom code
    Attributes: checked [attibutes: kmlurl, mapwidth,
   mapheight, upviewmode, upearthsphere, upmapsdefaulttype, shownavcontrols] Language:
   HTML Code:
 *     ```
       <p>%%content%%</p>
       <script src="http://www.gmodules.com/ig/ifr?url=http://code.google.com/apis/kml/embed/embedkmlgadget.xml
       &up_kml_url=%%kmlurl%%
       &up_view_mode=%%upviewmode%%
       &up_earth_2d_fallback=1
       &up_earth_fly_from_space=1
       &up_earth_show_nav_controls=1
       &up_earth_show_buildings=1
       &up_earth_show_terrain=1
       &up_earth_show_roads=1
       &up_earth_show_borders=1
       &up_earth_sphere=%%upearthsphere%%
       &up_maps_zoom_out=0
       &up_maps_default_type=%%upmapsdefaulttype%%
       &synd=open
       &w=%%mapwidth%%
       &h=%%mapheight%%
       &title=Google+Earth+Embed+using+Shortcode+Pro
       &border=%23ffffff%7C3px%2C1px+solid+%23999999
       &output=js"></script>
       ```
   
 * Enable: checked
    Prevent: unchecked
 * I also tested with only one attribute and it stops to work. Maybe I missed something.
 * By the way the “&” signs in the original javascrip were “&”, they are decoded
   by the plugin after I click save (anyways it works when I don’t use attributes).
 * Best regards,
 * C. Y. PAN
 *  Plugin Author [Matt](https://wordpress.org/support/users/sksmatt/)
 * (@sksmatt)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-shortcodes-pro-javascript/#post-2396271)
 * Hi Noixdarec,
 * It might be a escaping problem then. You should try returning this code with 
   PHP:
 *     ```
       $out ='<p>'.$content.'</p>
       <script src="http://www.gmodules.com/ig/ifr?url=http://code.google.com/apis/kml/embed/embedkmlgadget.xml
       &up_kml_url='.$atts['kmlurl'].'
       &up_view_mode='.$atts['upviewmode'].'
       &up_earth_2d_fallback=1
       &up_earth_fly_from_space=1
       &up_earth_show_nav_controls=1
       &up_earth_show_buildings=1
       &up_earth_show_terrain=1
       &up_earth_show_roads=1
       &up_earth_show_borders=1
       &up_earth_sphere='.$atts['upearthsphere'].'
       &up_maps_zoom_out=0
       &up_maps_default_type='.$atts['upmapsdefaulttype'].'
       &synd=open
       &w='.$atts['mapwidth'].'
       &h='.$atts['mapheight'].'
       &title=Google+Earth+Embed+using+Shortcode+Pro
       &border=%23ffffff%7C3px%2C1px+solid+%23999999
       &output=js"></script>';
   
       return $out;
       ```
   
 * Let me know if that helps,
 * Kind Regards!

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

The topic ‘[Plugin: Shortcodes Pro] Javascript?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcodes-pro_434343.svg)
 * [Shortcodes Pro](https://wordpress.org/plugins/shortcodes-pro/)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-pro/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Matt](https://wordpress.org/support/users/sksmatt/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-shortcodes-pro-javascript/#post-2396271)
 * Status: resolved