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
suresh dupadasuresh dupada 

Problem in VisualForce with JQuery usage Please Help me Out

<apex:page >
    <apex:includeScript value="{!URLFOR($Resource.satish,'/satish/js/jquery-1.8.3.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.satish,'/satish/js/jquery-ui-1.9.2.custom.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.satish,'/satish/js/jquery-ui-1.9.2.custom.min.js')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.satish,'/satish/css/ui-lightness/jquery-ui-1.9.2.custom.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.satish,'/satish/css/ui-lightness/jquery-ui-1.9.2.custom.min.css')}"/>
    <script type="text/javascript">

        j$=jQuery.noConflict();
        if(j$)
        {
            alert('Success');
        }
        else
        {
            alert('NOt loaded');
        }
      
     </script>
      <script type="text/javascript">
         j$(document).ready(function()
         {
           
         });
     </script>
   
</apex:page>




here i am dowonloaded the library file (http://jqueryui.com/download/#!version=1.9.2), and renamed the file like satish.zip the i am uploaded in to my sandbox as a static resources having the name satish instatic resources....... but i am not getting any messages as per my code like success..........
Please Help me out............ I am trying for so many days with diffierent sites.......... but i am unable to execute even single visualforce page having jQuery
Please help me ...................
                      i Would appriciate for any kind of replay..........................
Best Answer chosen by suresh dupada
Ruwantha  LankathilakaRuwantha Lankathilaka
As far as I see you are using both minified and non-minified versions. You should use one library (jquery-ui-1.9.2.custom.js or jquery-ui-1.9.2.custom.min.js)

Since these libraries are widly used in web you better get the advantage of google CDN

you can simply use the google libraries as follows (this will give you the loaded jquery version

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    
    <script type="text/javascript">
        if (typeof jQuery != 'undefined') {  
            // jQuery is loaded => print the version
            alert(jQuery.fn.jquery);
        }        
    </script>
Go to following link to see all the libraries hosted by google

https://developers.google.com/speed/libraries/devguide

All Answers

Ruwantha  LankathilakaRuwantha Lankathilaka
As far as I see you are using both minified and non-minified versions. You should use one library (jquery-ui-1.9.2.custom.js or jquery-ui-1.9.2.custom.min.js)

Since these libraries are widly used in web you better get the advantage of google CDN

you can simply use the google libraries as follows (this will give you the loaded jquery version

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    
    <script type="text/javascript">
        if (typeof jQuery != 'undefined') {  
            // jQuery is loaded => print the version
            alert(jQuery.fn.jquery);
        }        
    </script>
Go to following link to see all the libraries hosted by google

https://developers.google.com/speed/libraries/devguide

This was selected as the best answer
varun singh 12varun singh 12
<apex:page >
    <apex:includeScript value="{!URLFOR($Resource.varun,'/varun/js/jquery-1.8.3.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.varun,'/varun/js/jquery-ui-1.9.2.custom.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.varun,'/varun/js/jquery-ui-1.9.2.custom.min.js')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.varun,'/varun/css/ui-lightness/jquery-ui-1.9.2.custom.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.varun,'/varun/css/ui-lightness/jquery-ui-1.9.2.custom.min.css')}"/>
    <script type="text/javascript">

        j$=jQuery.noConflict();
        if(j$)
        {
            alert('Success');
        }
        else
        {
            alert('NOt loaded');
        }
      
     </script>
      <script type="text/javascript">
         j$(document).ready(function()
         {
           
         });
     </script>
   
</apex:page>
User-added image

Suresh please check jquery zip file unzip it
and check root/path is correct