Title: Shortcode within CNC Shortcode and JQuery
Last modified: January 25, 2023

---

# Shortcode within CNC Shortcode and JQuery

 *  Resolved [stv11c](https://wordpress.org/support/users/stv11c/)
 * (@stv11c)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/shortcode-within-cnc-shortcode-and-jquery/)
 * Hi, great plugin and am close to success with it, but would like to get your 
   opinion on the following.
 * I have my own custom shortcode which I have added in the CNC text editor as **[
   myshortcode]**.
 * I then added the CNC shortcode on the Page where I want it to appear and my custom
   shortcode content displays correctly, however, the JQuery within my custom shortcode
   is not running… or it runs too early/late or never.
 * Note that if I run the JQuery within the browser console after page load, then
   the content re-renders correctly.
 * It also works correctly when using **[myshortcode]** on it’s own within a Page.
 * I have also tried adding **request=”remote”** within the shortcode but no luck.
 * Any ideas why the JQuery has an issue when used with CNC?
 * Cheers!
    -  This topic was modified 3 years, 4 months ago by [stv11c](https://wordpress.org/support/users/stv11c/).
    -  This topic was modified 3 years, 4 months ago by [stv11c](https://wordpress.org/support/users/stv11c/).
    -  This topic was modified 3 years, 4 months ago by [stv11c](https://wordpress.org/support/users/stv11c/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/shortcode-within-cnc-shortcode-and-jquery/#post-16410534)
 * Hi [@stv11c](https://wordpress.org/support/users/stv11c/)
 * the CNC element is loaded via Ajax, but only the content, not the scripts.
 * I suggest you try the beta version 0.0.8.beta-1 that you can download here: [https://downloads.wordpress.org/plugin/content-no-cache.0.0.8.beta-1.zip](https://downloads.wordpress.org/plugin/content-no-cache.0.0.8.beta-1.zip)
 * The beta version provides the event “content_no_cache_added”.
 * You can add your custom JS code when that event fires. I mean something like 
   this:
 *     ```wp-block-code
       document.addEventListener('content_no_cache_added',function(){    //Call your JS function here});
       ```
   
 * If you need entire scripts, I suggest you load them dynamically when the event
   content_no_cache_added fires. If you need more information you can read here:
   [https://stackoverflow.com/questions/14521108/dynamically-load-js-inside-js](https://stackoverflow.com/questions/14521108/dynamically-load-js-inside-js)
 * I hope it helps
 * Have. a great day!
 * Jose
    -  This reply was modified 3 years, 4 months ago by [Jose Mortellaro](https://wordpress.org/support/users/giuse/).

Viewing 1 replies (of 1 total)

The topic ‘Shortcode within CNC Shortcode and JQuery’ is closed to new replies.

 * ![](https://ps.w.org/content-no-cache/assets/icon-256x256.png?rev=2687570)
 * [Content No Cache | Serve uncached partial content even when you add it to a page that is fully cached.](https://wordpress.org/plugins/content-no-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/content-no-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/content-no-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-no-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-no-cache/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/shortcode-within-cnc-shortcode-and-jquery/#post-16410534)
 * Status: resolved