Title: Javascript shortcode and dynamic text
Last modified: February 6, 2022

---

# Javascript shortcode and dynamic text

 *  Resolved [enricotv](https://wordpress.org/support/users/enricotv/)
 * (@enricotv)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/javascript-shortcode-and-dynamic-text/)
 * Hello,
    I’ve this js code in a shortcode:
 * <script language=”Javascript”>
    document.cookie = “myJavascriptVar = ” today 
   = new Date() document.write(today.getFullYear(),today.getMonth(),today.getDate(),
   today.getHours(),today.getMinutes(),today.getSeconds()); </script>
 * Now in CF7 with the Dynamic Text Extension plugin I can assign by default a value
   in a field obtaiden from the shortcode but in this field appair the entire code
   and not the result of the js code.
    Where is the problem? Thank you

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

 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/javascript-shortcode-and-dynamic-text/#post-15335345)
 * Hi [@enricotv](https://wordpress.org/support/users/enricotv/),
 * As I can understand, the entire code is displayed as-is instead of it getting
   executed?
 * In this case, please use the “code editor”, make sure the angle brackets (< and
   >) are not “encoded”
 * Thanks,
    Aakash
 *  Thread Starter [enricotv](https://wordpress.org/support/users/enricotv/)
 * (@enricotv)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/javascript-shortcode-and-dynamic-text/#post-15336007)
 * Thanks Aakash,
    the code is as you see above, so the brackets <and> are as you
   see there, so I don’t understand why it doesn’t works. I had also tried to use&
   lt; for < and & gt; for > but didn’t works anyway.
    -  This reply was modified 4 years, 3 months ago by [enricotv](https://wordpress.org/support/users/enricotv/).
    -  This reply was modified 4 years, 3 months ago by [enricotv](https://wordpress.org/support/users/enricotv/).
    -  This reply was modified 4 years, 3 months ago by [enricotv](https://wordpress.org/support/users/enricotv/).
 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/javascript-shortcode-and-dynamic-text/#post-15336801)
 * Hi [@enricotv](https://wordpress.org/support/users/enricotv/),
 * Ok then.. so when you say not working, can you please share more details?
 * Since the code is written by users, shortcoder plugin or me have no idea about
   what is it or how it works.
 * It would be better if you can test the code in an isolated page and debug what
   is happening.
 * I would first suggest to look at the page source and see if the shortcode content
   inserted is correct.
 * Thanks,
    Aakash

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

The topic ‘Javascript shortcode and dynamic text’ is closed to new replies.

 * ![](https://ps.w.org/shortcoder/assets/icon.svg?rev=2222236)
 * [Shortcoder — Create Shortcodes for Anything](https://wordpress.org/plugins/shortcoder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcoder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcoder/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcoder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcoder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcoder/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [vaakash](https://wordpress.org/support/users/vaakash/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/javascript-shortcode-and-dynamic-text/#post-15336801)
 * Status: resolved