O'Reilly logo

Programming Social Applications by Jonathan LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Data Source

First, we need to specify the source file that we will use to test our side-by-side comparison tool. For this example, we will load in this simple script as a proof of concept:

<h1>test 1 2 3</h1>
<div>this is a test</div>

<iframe src="http://www.yahoo.com" width="100%" height="200px">
   iframes not available
</iframe>

<script type="text/javascript">
   alert("I can alert to you!");
</script>

This mixed HTML/JavaScript markup will simply display a header and div, load an iframe, and then attempt to load an alert message to the user.

What we expect from the cajoled side of the content is the modification of this script to remove the iframe, which can load malicious pages, and display the alert message.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required