Title: Problem with Advanced ShortCode
Last modified: August 21, 2016

---

# Problem with Advanced ShortCode

 *  Resolved [ngvmx](https://wordpress.org/support/users/ngvmx/)
 * (@ngvmx)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/)
 * i just paste this basic script to ShortCode Template box;
 *     ```
       <script>
       document.write("<p>My First JavaScript</p>");
       </script>
       ```
   
 * then i select “Advanced ShortCode” option ftom “ShortCode Type”. But it doesnt
   work.
 * When i select “Simple One Tag ShortCode” or “Simple ShortCode with content” code
   works, i see “My First JavaScript” on post but “Advanced ShortCode” doesnt show
   anything.
 * [http://wordpress.org/plugins/shortcodes-ui/](http://wordpress.org/plugins/shortcodes-ui/)

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

 *  [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/#post-4467672)
 * Same problem here, the “Advanced Shortcode” doesn’t output anything that I put
   on the “ShortCode Template” field.
 *  [optimized-marketing](https://wordpress.org/support/users/optimized-marketingcom/)
 * (@optimized-marketingcom)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/#post-4467686)
 * The Advanced ShortCode JS Section could probably use some logical reworking. 
   The Advanced Shortcode JS section puts the content in the footer. This is fine
   if you are trying to define some functions. But if you are trying to do a document.
   write() to a specific location on the page it wont work because it will write
   it to the footer. So there is no way to use advanced shortcode js section and
   output JS to the location shortcode was placed.
 * If you are using Advanced Shortcode option I am pretty sure it ignores anything
   in the editor or in the shortcode template areas. It only takes into account 
   the information inside of the ShortCode Advanced Settings Section.
 * I would like to be able to define JS code that will show up in the footer(ex.
   js functions), and also be able to run specific JS code at the location of the
   shortcode(ex. document.write(“blah blah blah”))
 *  [GenealogyCoach](https://wordpress.org/support/users/samatva/)
 * (@samatva)
 * [12 years ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/#post-4467687)
 * Bad practice to use JS document.write(). Instead, create a <div> at the desired
   location, then write into that.
 * HTML:
    `<div id="addtext"></div>`
 * JS:
 * `document.getElementById("addtext").innerHTML="Text to write...";`
 *  [optimized-marketing](https://wordpress.org/support/users/optimized-marketingcom/)
 * (@optimized-marketingcom)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/#post-4467689)
 * Thanks for the best practice related to document.write() I will remember to use
   that.
 * Even with the best practice of creating html then editing it with js I still 
   see no way to do that while using Advanced Shortcode JS Option.
 * Unless I am missing something.
 *  Plugin Author [Bainternet](https://wordpress.org/support/users/bainternet/)
 * (@bainternet)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/#post-4467695)
 * You kind of made a mess of things,
    The advanced shortcode only uses the php 
   section and prints the JS at the `wp_footer` hook.
 * The Simple ShortCode with content
    uses the template so you can use you code 
   with that.
 * In version 1.9.9 you can use the template section content in the php section 
   by using the variable `$sc_template`;

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

The topic ‘Problem with Advanced ShortCode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcodes-ui_dbeef6.svg)
 * [ShortCodes UI](https://wordpress.org/plugins/shortcodes-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcodes-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-ui/reviews/)

 * 5 replies
 * 5 participants
 * Last reply from: [Bainternet](https://wordpress.org/support/users/bainternet/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/problem-with-advanced-shortcode/#post-4467695)
 * Status: resolved