aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Chrome question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Chrome question" Watch "Chrome question" New topic
Author

Chrome question

Popescu Gabi
Greenhorn

Joined: Nov 01, 2011
Posts: 7
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Chrome question