How can I change my javascript after it has been enqueued?

Writing my first plugin, trying to make it as simple as possible. I put simplistic functions in the javascript just so it would let me know it was there. Afterward I changed the methods in the javascript. WP doesn’t recognize that the javascript changed. It looks like this:

function registerjs()
{
wp_register_script(‘pcjavascript’, plugins_url(‘PerformantCalendar.js’, __FILE__));
//wp_dequeue_script(‘pcjavascript’);
//echo “ichi”;
wp_enqueue_script(‘pcjavascript’);
echo “ni”;
}

add_action(‘wp_enqueue_scripts’, ‘registerjs’);

The javascript file looks like this:

function monthNext()
{
alert(“In the haunted javascript file”);
}

function monthPrev()
{
alert(“This also works”);
}

Now if I change the message in the alert box, it still alerts by the first message. I’ve tried dequeueing the script, inactivating and reactivating the plugin. I’m missing something. Can somebody help?

Read more here:: How can I change my javascript after it has been enqueued?

Leave a Reply

Your email address will not be published. Required fields are marked *