Answer the question
In order to leave comments, you need to log in
Why can myajax fall off when reconnecting jquery?
Before that, everything worked and jquery was connected via functions
function my_scripts() {
?>
<script type="f71ad2114b19723ebddd10ca-text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery-3.6.0.min.js"></script>
<?php
}
function my_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', get_template_directory_uri() .'/js/jquery-3.6.0.min.js' );
wp_enqueue_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'myajax_data', 2000);
function myajax_data(){
wp_localize_script( 'jquery', 'myajax',
array(
'url' => admin_url('admin-ajax.php')
)
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question