📜 ⬆️ ⬇️

Avtoresayz IFRAME and secure way to transfer information from one domain to another

As you know, when working with frames to ensure security, browsers do not allow JavaScript code to access a page from one domain to a page from another domain. In this brief article, we will look at aspects of cross-domain work in JavaScript, describe one of the “good” special cases, and at the end - I hope to get answers to the remaining questions in the habrakommentov.

UPD1: those who are here for the first time - be sure to read the comments on this article, they have a lot of interesting things in them (as I hoped). Thank!

UPD2: Found a solution to the problem of autoresizing for everything except Opera <10.
')
UPD3: fully cross-browser solution to the resize problem is given below. Its features: a) history does not deteriorate, b) even works in Opera 7 and IE6, c) to speed up the work, the frame height is always made a multiple of N = 30 pixels. In fact, there are 2 algorithms - for IE (via location.hash) and for “non-IE” (via window.name and “tapping” possible heights in the loop). See also comments on the article; there are explanations why this is so and not otherwise.

UPD4: the article began to take on the features of monumental, so she moved to me in Nabla on dkLab: dklab.ru/chicken/nablas/58.html - there are all examples of code of the latest relevance. But, of course, in case of changes, I will announce them here, adding UPD5, UPD6, etc.

Source: https://habr.com/ru/post/78702/


All Articles