Ask your WordPress questions! Pay money and get answers fast! (more info)

issue with javascript WordPress

  • REFUNDED

this is what needs to be done. Can someone help.

Thanks

If you are familiar with Javascript and jQuery you probably know that including jQuery more than once may break all the code that is declared between the first and the second jquery inclusion, this happens because jQuery get declared again from zero, destroying all the plugins and functions added before.

To prevent this errors Wordpress uses a function that is called enqueue scripts, which allows the developer to register the scripts that will be used and then include them only one time even if it is called by more than one theme or plugin. Wordpress also includes a lot of the most famous Javascript libraries and they advice you to use them. You can read more about this here: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

WP Ajax Grid uses Wordpress and jQuery standards to include scripts files; however I see your theme is including this file: http://shahnazlovesbeauty.com/wp-content/themes/quarter/javascripts/foundation.min.js?ver=3.5.1 which is including another copy of jQuery which re-declares the jQuery library and crashes WP Ajax Grid scripts.

My advice is for you to take a look at the link I sent you and maybe contact your theme developer so they can use the propper WP functions to include jQuery, it will save you a lot of pain and time in the future.

Answers (2)

2013-03-16

Arnav Joy answers:

can you let us know what are things you want ?


Eben Fabricius comments:

i have two jquery versions. I need only one

see below:

WP Ajax Grid uses Wordpress and jQuery standards to include scripts files; however I see your theme is including this file: http://shahnazlovesbeauty.com/wp-content/themes/quarter/javascripts/foundation.min.js?ver=3.5.1 which is including another copy of jQuery which re-declares the jQuery library and crashes WP Ajax Grid scripts.


Eben Fabricius comments:

any ideas?

2013-03-18

Francisco Javier Carazo Gil answers:

Eben,

foundation.min seems to be importing again jQuery. Nevertheless, it is a "min" version, not a developer one, so we cannot change anything inside it in a good way.