You need to sign in to do that
Don't have an account?

unable to access DOM elements of standard page from jQuery in inline VF page
Hi Guys,
I have created a simple vf page and placed and small jQuery script in the vf page (below code). I have added this vf page as an inline VF page in the Case detail page. In the jQuery I am trying to pick up the case number by passing the id of the div in which the case number is present and alerting the result. But I am getting a blank pop-up.
But when I try the same, by placing the jQuery in the sidebar, its working just fine.
<apex:page standardController="Case">
<script src="/resource/jQueryLatest" type="text/javascript"></script> <script type="text/javascript"> j$(document).ready(function(){ var caseNumber = j$("#cas2_ileinner").text(); alert(caseNumber); }); </script>
</apex:Page>
Problem: not able to access the DOM elements of the standard detail page from a jQuery script which is placed in the inline vf page on the same page.
please help!
Regards
Sam
Hi RItesh,
Thanks for the reply. I had placed the noConflict statement, but forgot mention it in the below code, thanks for pointing that out. But also got to know that one cannot access the standard page's DOM element from a jQuery script placed in a inline VF page.
Thanks
Sameer
All Answers
The embedded VF Page is a (child) iframe of the main parent window, therefore try this
(Also you need to use .noConflict as $ is also a sort of a reserved symbol for Global Variables in Visualforce)
Hi RItesh,
Thanks for the reply. I had placed the noConflict statement, but forgot mention it in the below code, thanks for pointing that out. But also got to know that one cannot access the standard page's DOM element from a jQuery script placed in a inline VF page.
Thanks
Sameer