function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
beginner apexbeginner apex 

how to use Jquery in visualforce

Hi ,

 

I want to use Jquery in visualforce , can i have any materials to learn jquery in salesforce , 

plz any materials send that url

 

 

Regards,

GaneZ

Satish_SFDCSatish_SFDC

Hi,

I see that there is already a thread created by you for this topic.

 

http://boards.developerforce.com/t5/General-Development/how-to-use-Jquery-in-visualforce/td-p/646893

 

 

Regards,

Satish Kumar

 

SachinSankadSachinSankad

Hi,

 

To use JQuery in visualforce page, you need to download JQuery library zip file from JQuery website.

 

You need to create static resource of this JQuery zip file in your developer accout / salesforce account in which you are goint to run respective visualforce page.

 

You can refer to following code as well for reference :

 

<apex:page>
<!-- Begin Default Content REMOVE THIS -->

<h1>Congratulations</h1>
This is your first page.
<apex:messages />
<!-- End Default Content REMOVE THIS -->
<apex:form >
<apex:pageBlock >
<apex:includeScript value="{!URLFOR($Resource.jQuery, 'js/jquery-1.8.3.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.jQuery, 'js/jquery-ui-1.9.2.custom.min.js')}"/>
<apex:stylesheet value="{!URLFOR($Resource.jQuery, 'css/ui-lightness/jquery-ui-1.9.2.custom.css')}"/>

<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function()

{
       j$("#ninjaLink").click(function()

      {
               alert("NINJA STAR TO FACE!!!!!");
       });
});
</script>
<button id="ninjaLink">NINJA ATTACK!</button>
<apex:pageBlockSection id="pgBlcSec1" columns="1" collapsible="true" title="Trial">
HI
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

If this post is helpful to you, please don't forget to give kudos.

 

Regards,

Sachin Sankad.