poo
poo

Reputation: 1115

Why is this javascript getting permission denied?

Permission denied for <http://example.com> to get property

HTMLDocument.body from http://www.example.com.

var c = parseFloat(cf.contentDocument.body.offsetHeight) + 30; 

Upvotes: 2

Views: 1624

Answers (2)

Residuum
Residuum

Reputation: 12064

With a little guessing about your question, I see 2 possibilies:

  1. Javascript will not let you read data from other domains via Ajax, and you read from a domain different than example.com

  2. You read data from example.com, but you really try to read from www.example.com, and the webserver only serves on www.example.com.

Upvotes: 1

MitMaro
MitMaro

Reputation: 5927

I believe this is due to the Same Origin Policy implemented by most (all??) browsers. Simply put example.com is not the same origin as www.example.com.

Upvotes: 5

Related Questions