+ Start a Discussion
Kennette RodriguezKennette Rodriguez 

jQuery + Visualforce

Hello, 

I was trying to make an example of jQuery with visualforce, I was adding as static resource the jQuery library. Then I was using the following code in a new VF page:
 
<apex:page id="page">
    <apex:form id="form">
        <apex:outputPanel id="panel">
            <apex:inputText id="input" onfocus="foo();" />
        </apex:outputPanel>
    </apex:form>
    <!-- Uploaded jQuery as a static resource -->
    <apex:includeScript value="{!URLFOR($Resource.jQuery, 'js/jquery-1.7.2.min.js')}" />
    <script>
        function foo() {
            jQuery( 'input[id$=input]' ).val('Foo');
        }
    </script>
</apex:page>
Look like it added the reference, but I am not sure if it located the file, inside the folder of the jQuery library I found the following files:

Folders
Do you think is cause the references path? what should I use?
I changed to: js/jquery-ui.min.js and still the same, without work.

Thank you very much,
I will apreciate your help!
JitendraJitendra
Hi,
In your browser go to "View Page Source", I would recommend to use Google Chrome. You cna click on generated link, if its does not give you 404 error that means you are good.