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
skausskaus 

JQuery newbie.. need help

Hi I am trying to make my visualforce page pretty by applying some cool Jquery features. But I am just not able to start off.

 

I have a VF page that is included as a section in the opportunity standard page layout. I want this page not to appear at one go but rather as a link and then something like slider thing that shows the whole page. The reason is , this inserted page is long and it makes the overall page too long.

 

Why won't below work ?...

<script src="{!URLFOR($Resource.jQueryFiles, 'js/jquery-1.4.4.min.js')}"/> <script src="{!URLFOR($Resource.jQueryFiles, 'js/jquery-ui-1.8.7.custom.min.js')}"/> <script type="text/javascript"> var $j = jQuery.noConflict(); $j(document).ready(function(){ $j("#trying").dialog({ autoOpen: false, modal: true, position: 'center' }); }); }); </script>
//Page code with pageblocksection and stuff

 



 



Cory CowgillCory Cowgill

I think the problem is you are including the VF page on the page layout.

 

Standard Pages and Visualforce Pages are hosted on two different domains. Javascript cannot execute across domains, so your Javascript will not work if your mixing a Standard Page and a Visualforce Page. This is common frustration.

 

The way to implement what you want to do is replace the Standard page with a Visualforce Page. You can use the <apex:detail> tag to bring in the Layout's and still maintain the point and click config of the page layout.

 

Then, underneath the <apex:detail> tag, you would include your customizations. Then your Javascript should execute cleanly becuase all the code is under the same domain.

 

Make sense?