Namespacing missing for javascript variable ajax_url which give syntax error

Viewing 6 posts - 1 through 6 (of 6 total)
#154865

Praveen Mudaliar
Participant

Hello There,
We are getting syntax error because of namespace is missing in variable name ajax_url.

Can you please update it as var name ajax_url is very common and it may conflict.

Details :

SyntaxError: Identifier ‘ajax_url’ has already been declared

<script>

var wpdm_site_url = ‘<?php echo site_url(‘/’); ?>’;

var wpdm_home_url = ‘<?php echo home_url(‘/’); ?>’;

var ajax_url = ‘<?php echo admin_url(‘admin-ajax.php’); ?>’;

var wpdm_ajax_url = ‘<?php echo admin_url(‘admin-ajax.php’); ?>’;

var wpdm_ajax_popup = ‘<?php echo get_option(‘__wpdm_ajax_popup’, 0); ?>’;

</script>

#154866

Humayon
Spectator

Hi @praveenk,
You are getting the syntax error most probably for the other third-party plugins.
For now, you need to comment out the line or deactivate other plugins if that is not required. Also, in the next major update, we have already scheduled to remove those vars.
After that update, they will be like wpdm.ajax_url.
Hope you understand.
Thank you

#155648

Praveen Mudaliar
Participant

Hello Humayon,
When we can see the major release which you have mentioned ?

#155649

Shahjada
Keymaster

Hopefully, within the next week, we are almost done with testing.

#158378

Praveen Mudaliar
Participant

When we will be having release for this fix ?

#158381

Humayon
Spectator

Hello @praveenk,
Sorry for the inconvenience.
We will implement/adjust the issue in the upcoming update 3.2.13 which will be released within this week.
So, please spare us some additional time.
Cheers!

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Namespacing missing for javascript variable ajax_url which give syntax error’ is closed to new replies.