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
veeru417veeru417 

Java script is not working in Visualforce page?

We have created a page which we used to display a dashboard on home page component.Whenever we click on that dashboard it will open related report.Earlier it used to work now it's not working.Below is the VF code.Attached a screenshot for the error which I see when I do inspect element.Can some one help me what's the issue.
User-added image
 
<apex:page showHeader="false" sidebar="false">
    <apex:outputPanel >
         <script>
              location.href="/01Zd0000000m6TR?isdtp=vw";
         </script>
     </apex:outputPanel>
</apex:page>


 
Waqar Hussain SFWaqar Hussain SF
<apex:page showHeader="false" sidebar="false">
    <apex:outputPanel >
         <script>
$(document).ready(function() {
              window.location.href="/01Zd0000000m6TR?isdtp=vw";
});
         </script>
     </apex:outputPanel>
</apex:page>

try above code
Swayam@SalesforceGuySwayam@SalesforceGuy
Hi,

I think its problem with iFrame,  trying using below code 
<apex:page showHeader="false" sidebar="false">
    <apex:outputPanel >
         <script>
             wnidow.parent.location.href="/01Zd0000000m6TR?isdtp=vw";
         </script>
     </apex:outputPanel>
</apex:page>

Hope this helps,

--
Regards,
Swayam
@Salesforceguy