Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Created October 12, 2012 08:12
Show Gist options
  • Save Ajnasz/3877937 to your computer and use it in GitHub Desktop.
Save Ajnasz/3877937 to your computer and use it in GitHub Desktop.
Remove iframe grower bug
YUI().use('node', 'test', function (Y) {
"use strict";
var suite, spies, loginRequest, subscription;
spies = {};
loginRequest = {};
suite = new Y.Test.Suite({
name: 'Test'
});
suite.add(new Y.Test.Case({
name: "Test removing iframe",
setUp: function () {
},
tearDown: function () {
document.body.removeChild(document.getElementsByTagName('iframe')[0]);
},
"Test iframe": function () {
var iframe = document.createElement('iframe');
iframe.src = 'test.html';
document.body.appendChild(iframe);
}
}));
Y.Test.Runner.add(suite);
Y.Test.Runner.run();
});
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Test remove iframe</title>
<script src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js"></script>
<script src="a.js"></script>
</head>
<body><div></div></body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Iframe-content</title>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment