<commit_before># Cross domain iframe resizer

This is a simple plugin to enable the resizing of cross domain iframes to fit the contained content.

This package contains two minified JavaScript files in the <a href="js">js</a> folder. The first (<a href="jquery.iframeResizer.min.js">jquery.iframeResizer.min.js</a>) is a **jQuery** plugin for the page hosting the iframe. The second one (<a href="iframeResizer.contentWindow.min.js">iframeResizer.contentWindow.min.js</a>) is **native** JavaScript file that needs placing in the page contained within your iframe.

This plugin is built using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage">window.postMessage API</a> to pass messages between the host page and the iframe. To see this working take a look at the <a href="http://davidjbradshaw.com/iframe-resizer/example/">example</a> and watch the console log.

The code supports resizing the iframe when the browser window changes size or the content of the iframe changes. For this to work you need to set one of the dimensions to a percentage and tell the plugin only to update the other dimension. Normally you would set the width to 100% and have the height scale to fit the content.

To set the plugin up for this create a basic iframe tag with the following options.

	<iframe src="http://anotherdomain.com/frame.content.html" width="100%" scrolling="no"></iframe>

Note that scrolling is set to 'no', as older versions of IE don't allow this to be turned off in code and can just slightly add a bit of extra space to the bottom of the content that it doesn't report when it returns the height.

Next we initialize the plugin on the page hosting file for our iframe. This example shows all the default options and the values returned to the callback function.

	$('iframe').iFrameSizer({

		log: false,
		contentWindowBodyMargin:8,
		doHeight:true,
		doWidth:false,
		enablePublicMethods:false,
		interval:0,
		autoWindowResize: true,
		callback:function(messageData){
			$('p#callback').html('<b>Frame ID:</b> ' + messageData.iframe.id + 
								' <b>Height:</b> ' + messageData.height + 
								' <b>Width:</b> ' + messageData.width 
								' <b>Event type:</b> ' + messageData.type);
		}<commit_msg>typos<commit_after># Cross domain iframe resizer

This is a simple plugin to enable the resizing of cross domain iframes to fit the contained content.

This package contains two minified JavaScript files in the <a href="js">js</a> folder. The first (<a href="js/jquery.iframeResizer.min.js">jquery.iframeResizer.min.js</a>) is a **jQuery** plugin for the page hosting the iframe. The second one (<a href="js/iframeResizer.contentWindow.min.js">iframeResizer.contentWindow.min.js</a>) is **native** JavaScript file that needs placing in the page contained within your iframe.

This plugin is built using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage">window.postMessage API</a> to pass messages between the host page and the iframe. To see this working take a look at the <a href="http://davidjbradshaw.com/iframe-resizer/example/">example</a> and watch the console log.

The code supports resizing the iframe when the browser window changes size or the content of the iframe changes. For this to work you need to set one of the dimensions to a percentage and tell the plugin only to update the other dimension. Normally you would set the width to 100% and have the height scale to fit the content.

To set the plugin up for this create a basic iframe tag with the following options.

	<iframe src="http://anotherdomain.com/frame.content.html" width="100%" scrolling="no"></iframe>

Note that scrolling is set to 'no', as older versions of IE don't allow this to be turned off in code and can just slightly add a bit of extra space to the bottom of the content that it doesn't report when it returns the height.

Next we initialize the plugin on the page hosting file for our iframe. This example shows all the default options and the values returned to the callback function.

	$('iframe').iFrameSizer({

		log: false,
		contentWindowBodyMargin:8,
		doHeight:true,
		doWidth:false,
		enablePublicMethods:false,
		interval:0,
		autoWindowResize: true,
		callback:function(messageData){
			$('p#callback').html('<b>Frame ID:</b> ' + messageData.iframe.id + 
								' <b>Height:</b> ' + messageData.height + 
								' <b>Width:</b> ' + messageData.width +
								' <b>Event type:</b> ' + messageData.type);
		}
{'fraction_non_alphanumeric': 0.09418837675350701, 'fraction_numerical': 0.0035626809173903364, 'mean_word_length': 4.341260404280618, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6550443', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1226, 'n_words': 558}