Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chrome question

 
Popescu Gabi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'll start by saying that i don't have a lot of experience with Javascript.

I created an iframe and i need it to communicate with the main window. I wrote this code in the main window (dropFrame being the iframe):



Of course, the iframe has a function called changeDragObject(obj). It works in IE, Opera and Mozilla but not in Chrome. Accessing Chrome's console, i see it throws these errors:


* Unsafe JavaScript attempt to access frame with URL file:///F:/Folder/DOM%20Drag%20Drop/dropPage.html from frame with URL file:///F:/Folder/DOM%20Drag%20Drop/MainPage.html. Domains, protocols and ports must match.
* Uncaught TypeError: Property 'changeDragObject' of object [object Window] is not a function



I'm guessing the second error is the one which leads to the crash, but i don't know why.
Could you tell me how to get rid of that error? Thank you.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should never work off the file protocol when developing since it has different security restrictions than http. Use a local webserver, it is easy to set up/run.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic