Title: cannot create code block on fresh install
Last modified: August 21, 2016

---

# cannot create code block on fresh install

 *  [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/)
 * i’ve installed wp into a subdomain and this is the first time i’m having trouble
   with this plugin, so i wonder if it is related.
 * all other plugins are inactive.
 * i can click the button to create the new code block, type the name, and then 
   click create, but it does nothing.
 * i inspected the JS console and I’m seeing this error when i click the “create
   code block” button:
 * `Uncaught ReferenceError: ajaxurl is not defined`
 * i see this error when i click the create button:
 * `Uncaught TypeError: Object [object Object] has no method 'serializeObject'`
 * I have worked on plugins which utilize the ajaxurl. I’ll see if the JS code is
   getting messed up.
 * [https://wordpress.org/plugins/css-javascript-toolbox/](https://wordpress.org/plugins/css-javascript-toolbox/)

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

 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649539)
 * seems ok … right beneath the title:
 *     ```
       <script type="text/javascript">
       addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
       var ajaxurl = '/wp-admin/admin-ajax.php',
       	pagenow = 'toplevel_page_cjtoolbox',
       	typenow = '',
       	adminpage = 'toplevel_page_cjtoolbox',
       	thousandsSeparator = ',',
       	decimalPoint = '.',
       	isRtl = 0;
       </script>
       ```
   
 *  [Code Machine](https://wordpress.org/support/users/xpointer/)
 * (@xpointer)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649653)
 * Unfortunately, another user has the same issue! ajaxurl is being use all around
   by CJT however while the new-block form is popped up its not being use ajaxurl
   yet. I’ve a doubt regards the other user its because of the Theme! Did you managed
   to test another theme, what theme you’re using!
 * BTW: Uncaught ReferenceError: ajaxurl is not defined error is occurred while 
   the new form is initialized while the second error when click ‘Create’.
 * You also might notice that the source of the error is not start by any CJT Javascript
   file/script its start from the other scripts and almost its just below jquery-
   ui-color jQuery Plugin. It tries to access ajaxurl variable while its not being
   defined. WordPress defining ajaxurl only when the request is belong to WordPress(
   Plugin Page, Edit Post, etc..). CJT is totally aware of that and being accessing
   ajaxurl from the window.parent frame via window.parent.CJTBlocks.server object.
   So it never touch ajaxurl from new-block view.
 * Thanks for your help.
    I would like to hear your thoughts regards what I’ve said
   as I need to get it solved.
 * Thanks,
    AHMeD
 *  Thread Starter [James Revillini](https://wordpress.org/support/users/jrevillini/)
 * (@jrevillini)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649809)
 * I’ll keep digging into this and see if I can give any better information. Thank
   you for the response. Unfortunately, I can’t remember which site I was working
   on when this error occurred, but I’ll try to figure it out.
 *  [pezomatic](https://wordpress.org/support/users/pezomatic/)
 * (@pezomatic)
 * [12 years ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649842)
 * I am using [this theme](http://theme.co/x/) and when the theme is active I am
   unable to create new scripts. If I switch themes temporarily I can create scripts
   that are editable in the main theme when I reactive it.
 *  Plugin Author [wipeoutmedia](https://wordpress.org/support/users/wipeoutmedia/)
 * (@wipeoutmedia)
 * [12 years ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649843)
 * Hi pezomatic,
 * Thanks for your support enquiry. We have received another email regarding an 
   issue with this immensely popular theme and we hope to look further into this
   in the coming days. We will keep you posted of our findings.
 * Kind Regards,
    Damian
 *  [DragonDon](https://wordpress.org/support/users/dragondon/)
 * (@dragondon)
 * [12 years ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649845)
 * I was running into the exact same issue. I switched back to the 2014 theme, deactivated
   all the plugins and went through each one (only had 5 plugins total, including
   this one!) and the bugger that was killing it (naturally the LAST one in the 
   list) was “WP Error Fix”. How strange but then again, I don’t really understand
   much of the ‘under the hood; things that happen within wordpress. Just thought
   I’d pass that along.
 * Oh, and this is on a local install on my Linux Mint machine.
 *  [pezomatic](https://wordpress.org/support/users/pezomatic/)
 * (@pezomatic)
 * [12 years ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649846)
 * Thanks. I will try your plugin again in the near future.
 *  [Code Machine](https://wordpress.org/support/users/xpointer/)
 * (@xpointer)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649859)
 * Hello Guys,
 * Great! We’re sorry for the delay.
 * I just discovered what is causing the issue. As I said its the Theme link/output
   scripts (wp-list, etc…) within CJT AJAX Requests while it shouldn’t do.
 * However the CJT Plugin owner would like to get a solution for CJT instead of 
   asking the Theme Authors to don’t conflict with CJT Plugin. We’re checking a 
   solution.
 * The issue is as following
 * #file: wp-content/themes/x/framework/functions/global/admin/sidebar.php
    #lines:
   98, 99 and 100
 * So it seems that the X theme enqueue/output/link Dashboard Sidebars javascript
   in the CJT Ajax request! while those scripts should linked only in the specific
   page they’re targeting!!!!! It uses admin_init to link scripts while it should
   use one of the scripts related actions/filters.
 * I will let you know guys once its done.
 * Regards,
    AHMeD
 *  [pezomatic](https://wordpress.org/support/users/pezomatic/)
 * (@pezomatic)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649860)
 * Great. Thanks.
 *  [elprimo550](https://wordpress.org/support/users/elprimo550/)
 * (@elprimo550)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649872)
 * Is there an ETA/Workaround for this fix?
 *  [smathis](https://wordpress.org/support/users/smathis/)
 * (@smathis)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649881)
 * Hi AHMeD –
    Any update on this?
 * The theme that has this problem (X Theme) is very popular and will continue to
   have lots of users. Your plugin is also very popular (since it’s awesome!)…so
   it would be great if they can play nicely together!
 * Thanks 🙂
 *  [Code Machine](https://wordpress.org/support/users/xpointer/)
 * (@xpointer)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649882)
 * Hello –
 * Thanks for the reminder!
 * Yeah I find a workaround for this.
 * will contact the Plugin owner.
 * I believe we will make a new release soon for this issue.
 * I will let you know.
 * Regard,
    AHMeD
 *  [Code Machine](https://wordpress.org/support/users/xpointer/)
 * (@xpointer)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649896)
 * Hello,
 * This issue has been fixed.
 * We might release the new version by Thursday or Friday.
 * Regards,
    AHMeD
 *  [Code Machine](https://wordpress.org/support/users/xpointer/)
 * (@xpointer)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649897)
 * This should be solved.
 * Is it?

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

The topic ‘cannot create code block on fresh install’ is closed to new replies.

 * ![](https://ps.w.org/css-javascript-toolbox/assets/icon-256x256.gif?rev=3132209)
 * [CSS & JavaScript Toolbox](https://wordpress.org/plugins/css-javascript-toolbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/css-javascript-toolbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/css-javascript-toolbox/)
 * [Active Topics](https://wordpress.org/support/plugin/css-javascript-toolbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/css-javascript-toolbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/css-javascript-toolbox/reviews/)

 * 14 replies
 * 7 participants
 * Last reply from: [Code Machine](https://wordpress.org/support/users/xpointer/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/cannot-create-code-block-on-fresh-install/#post-4649897)
 * Status: not resolved