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
CB312CB312 

Unsafe JavaScript attempt to access frame with URL

Hi,

 

I have a custom visualforce page with some javascrpit in it and I am getting this error: Unsafe JavaScript attempt to access frame with URL

 

Can someone help me figure out why the values are being passed incorrectly.

 

<apex:page standardController="lead" showheader="false" sidebar="false" id="pgId"> 
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.js"/>
<apex:includeScript value="{!URLFOR($Resource.tablesorter, 'jquery.tablesorter.js')}"/>
<apex:stylesheet value="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/trontastic/jquery-ui.css"/>


<body>
  <p id="hello">Hello World</p>
  <a href="http://www.google.com" class="name">google</a>
  <a href="http://www.yahoo.com" class="name">yahoo</a>
</body>
  <div id = "searching" title= "Searching.............">
  </div> 

<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(function(){
  $j("#searching" ).dialog({ 'autoOpen': true });
});
 
</script>

</apex:page>

 this throws:

 Unsafe JavaScript attempt to access frame with URL https://c.cs7.visual.force.com/servlet/servlet.Integration?lid=XXXXXXXXXXX&ic=1 from frame with URL https://cs7.salesforce.com/XXXXXXXXXX. Domains, protocols and ports must match.

 

sherodsherod

It's a security feature of Javascript called Same Origin Policy.

 

http://en.wikipedia.org/wiki/Same_origin_policy

 

That said, I can't see why you are having a problem with the code you have posted.  Is that the entire page?

 

Would you by any chance be using the Development Mode Footer/inline VF editing?  Try turning it off.

Neil1232Neil1232

Hi, Did you find any solution to this problem? 

 

I think its just a general problem of having a VF page within a home page component?

 

Similar thread..http://boards.developerforce.com/t5/General-Development/Chrome-error-quot-Unsafe-JavaScript-attempt-to-access-frame-with/m-p/499305/highlight/false#M75580