update canonical link tag using jquery

update canonical link tag using jquery

Hi all this is my 1st post here =]

I'm developing using wordpress 3.01 and for some reason i need to update the canonical link tag using jquery using jquery

here is what i original have:

<link rel='canonical' href='http://example.com.sg/jobs/' />

and i need to  change it to

<link rel='canonical' href='http://example.com.sg/jobs/view/someRandomID' />




my wordpress plugin allow me to fetch the correct URL via  <?php wpjb_job_url() ?>
So im assuming the code to be something like

<script type="text/javascript">
    jQuery(function() {
      jQuery("#testing").attr({'href':<?php wpjb_job_url() ?>});
    });
</script>


Problem is as the canonical link tag is being generate by wordpress, there isn't any way i can assign an ID to it for targeting. Is there anyway i can still change the link tag without any ID targeting?



Thanks!
chup