How to debug Javascript interactive issues

February 25, 2016

This is a very common question/issue we get reported all the time. Here is how to resolve this issue and debug to find what is causing this issue on your site.

NOTE: EventON should work 100% out of the box as we have tested multiple times before we release. But when its places inside badly made themes and plugins conflicts are unavoidable.

 

Preliminary Check for Javascript issues

In Chrome press F12 or Ctrl +shift+I and open the web developer console.

 

You should see below screen show in your browser. Pay attention to the top right corner.

Capture

 

If you see a RED cross with a number this means the number of  javascript errors on this page in your website.

Click Esc or switch over to the Console tab

Capture

This should show all the javascript errors on the page explained little bit more with some info.

 

Cause #2

If none of the above items matches your case, in the developer tools in your browser click on the Network tab.

If you see below error – marked in red. Or similar issue that have to do with admin-ajax.php – that comes up when you click on eventON calendar elements/buttons – Please follow below directions to solve this.

Capture

This could mean there are PHP code errors stopping eventON from executing AJAX commands.

SOLUTION: In this case we ask you to do a debug.

Perform a debug on PHP code

 

Solving Other Common Javascript Issues

Every javascript error is specific to a website and we can not give the solution to your own issue. But any javascript error you see in the console may conflict with eventON script and will stop from eventON script from running. Hence, you can not slideDown events and can not switch months.

Below are common solutions. Please go through them and try the ones that may apply in your case.

Solution #1

In this console on the right side shows the URL and sometimes line number of where this error is coming. You can look into that to see if you can figure out whats wrong and fix it.

Solution #2

If those javascript errors are not coming from any of the eventON js files. And you can identify which theme or plugin it is coming from. We recommend you contact the theme/plugin developer of those items for solution.

Solution #3

Capture

Right click on the web page and click view page source. And then Ctrl+f or search the source for “eventon_script.js” This is the main eventON javascript required for interactive functionality. If you can not find this in the page source try this:

Talk to your web developer/ theme developer and see why javascripts are not getting appended into footer — via wp_enqueue_script()

Another solution is, open footer.php file from your theme file and see if it has wp_footer() — a properly built theme should have this in the footer to allow plugins to append javascript files. So if your footer.php does not have this, add that in.

 

 

Cause #3 – shortcode

If you are using incorrect shortcodes than the result you are expecting that may also lead to none responsive calendar. For example if you use ux_val=’x’ in the shortcode clicking on events will not open the event card or do anything.

SOLUTION:

Start removing shortcode parameters one by one until the calendar start working. And then work your way up to what was wrong in the shortcode parameters you used. (shortcode parameters are shortcode peices like ux_val=’2′ or fixed_month=’4′)

Other causes for month switch not working

My site load inside pages via AJAX

If your website inside pages as well as the events page with eventon shortcode is loading via ajax into view (AKA browser does not show as reloading a new page but a new page shows in place of current page).

This is happening because required eventon scripts are not loaded on the new AJAX pages with eventon.

SOLUTION:

add the below PHP code to (footer.php file in your theme) to manually include eventon javascript files in all pages in your website.

[code]

global $eventon;

$eventon->frontend->load_default_evo_scripts();

[/code]

 

Still can not solve my issue

If the above solutions does not apply to your issue nor helped you solve your issue, please send us a ticket in support forum and please mention your findings in here to help us track your issue faster and solve it quick for you.

 

Did this article help you? If not, send us a ticket via helpdesk

Ready to setup your calendar?