• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Chrome question

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic