How can I include Jquery in my Wordpress footer?

I want to .load the php script every 10 seconds. The load code is not a problem, but in Wordpress all plugins use their own Jquery libraries, and if I just add the jquery google link:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>

the other plugins will crash.

I have the following code in my footer:

<?php
if ( is_user_logged_in() ) {
include 'completed.php';
}
?>

I want to include a jquery script so I can execute the following code:

<?php
if ( is_user_logged_in() ) { ?>
<div id="completed">
    <script>
    $(function(){
        setInterval(function(){
               $("#completed").load("completed.php");
        }, 10 * 1000);
    });
    </script>
</div>
<?php } ?>

Do you think you can help me out?

Answers


Load the jquery from google ajax library in footer

function my_init() {
    if (!is_admin()) {
        // comment out the next two lines to load the local copy of jQuery
        wp_deregister_script('jquery'); 
        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false, '1.3.2', true); 
        wp_enqueue_script('jquery');
    }
}
add_action('init', 'my_init');

Need Your Help

Android AlarmManager: how to find out the time remaining to trigger the PendingIntent

java android alarmmanager android-pendingintent

I am developing an alarm clock app. Below I have a function to set the alarm. But I want to know how to find the remaining time AlarmManager to trigger the PendingIntent.

Add a generator in a gem for Rails 2

ruby-on-rails ruby generator

I have a gem that I need to work with Rails 2 and 3, I am trying to get the generator to work for Rails 2 now, the Rails 3 generator work fine. I have a directory structure like:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.