5

When I try to open window.open('file///C:\calendar.html') it throws

Access Denied error

How do I fix this? Thanks

bluish
  • 26,356
  • 27
  • 122
  • 180
Silas Njoroge
  • 51
  • 1
  • 2

2 Answers2

4

Could it be that the colon is missing?

'file:///C:\calendar.html'

Edit: Might also need to do only two forward slashes, and escape the backslash: 'file://C:\\calendar.html'. Not sure you can open local files via JavaScript though, like the other answer says.

Victor Zamanian
  • 3,100
  • 24
  • 31
4

Usually you'll won't be allowed to open files from the client's filesystem as this would pose a huge security hole. No browsers would allow it.

You could use signed scripts to do that. For a detailed description check: http://www.mozilla.org/projects/security/components/signed-scripts.html This is of course browser specific.

Ioan Alexandru Cucu
  • 11,981
  • 6
  • 37
  • 39