jQuery in the PC2?

Options

I'm trying to add a jquery plugin on the homepage of a participant center, but it seems none of the jquery calls are being understood. I have a working version of the code in pagebuilder, but when I embed the page in the participant center it stops working. I tried something very simple just to see if I could get a Jquery call to work -- the following code changes the click on an anchor.But it doesn't work as soon as it is in the PC2 -- whether or not i reference the jQuery library.

 

<script type="text/javascript">

jQuery('#testlink').click(function (){

   alert("yes");

});

</script>

 

I see that the PC2 pulls in the jquery library by default and also calls the noconflict function to release the "$" call. Has anyone run into this before and found a way to get the jquery library to work within the confines of the PC2?

 

 

Thanks,

Jeffrey

Tagged:

Comments

  • After further investigating we found that no javascript placed in the home page of the participant center works, unless it is contained within an html tag, such as an onclick attribute in an anchor tag. We believe it has to do with the page being rendered by javascript itself.

     

    The custom JS file for the participant center (accessible under Teamraisers > Participant Centers tab > edit a participant center > Options > edit custom js) does let you reference the jquery library, but it makes the use of plugins tricky.

     

    We ended up placing all of the jquery plugin within a reusable page and using an iframe to pull it in to the participant center's home page. Another potential solution was to make direct edits to the dashboard.html file for the participant center in question on the client ftp, but since the participant center relies on so many conditionals to display its content we abandoned this solution as it caused the plugin to load either above or below the participant center as a whole.

     

    -Jeffrey

Categories