📜 ⬆️ ⬇️

MooTools - AJAX + document.write

Finally, one of the “giant libraries” decided to implement correct document.write processing when using AJAX. MooTools Core Dev Thomas Aylott demonstrates the document.write redefinition algorithm .

Using this algorithm will allow in AJAX to load HTML pages with scripts containing document.write. These can be pages with Google AddSense, pages containing JavaFX, others.

From the analysis of the algorithm follows That correct processing is possible only for not very complex combinations using document.write. For example, about options
')

document.write('<script ');
document.write('src="test.js" ');
document.write('</script>');

and

<script>document.write("<select>");</script><option>A<option>B</select>

The proposed algorithm "breaks the teeth."

But, all the same, this is better than nothing. We hope with time will add the ability to handle more complex situations.

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


All Articles