You need to sign in to do that
Don't have an account?
EricBrownGTM
jQuery not executing in VisualForce Page
I am using a VisualForce page for our Yammer embedded feeds and I am trying to modify some CSS via jQuery. I'm not exactly sure what is wrong, but the jQuery event won't execute and there for there is no CSS modification happening. Here is my code:
<apex:includeScript value="{!$Resource.YamEmbedJ}"/>
<script type="text/javascript">
$(window).load(function(){
$('yj-message-container').css('padding-left','40px');
});
</script>
The YamEmbedJ is a static resource of the jQuery library. I have also tried (document).ready event firing and no luck. Any assistance is appreciated.
Thank you everyone for the responses. I was able to actually use some custom CSS in a VisualForce page and just override the existing styles that were not working. Ended up not needed to use jQuery, but I will certainly keep the noConflict in mind for future applications. Thank you, again.
All Answers
try using jQuery.noConflict() along with your code
Use firebug or web developer tool for debugging jQuery or javascript issues.
You should pay attention for two key point:
- To use $.noConflict();
This way you dont have a conflict jquery vs salesforce libraries.
- Use jquery ready function:
Best
Thank you everyone for the responses. I was able to actually use some custom CSS in a VisualForce page and just override the existing styles that were not working. Ended up not needed to use jQuery, but I will certainly keep the noConflict in mind for future applications. Thank you, again.