Skip to main content

Bug Tracker

Side navigation

Ticket #3690: index.html


File index.html, 1.0 KB (added by darren, December 05, 2008 06:59PM UTC)
<!-- bug: <link rel="stylesheet"> tags must come before the <script src="jquery.js"> tag in Safari -->
	
<html>
	<head>

		<script src="jquery-1.2.6.js" type="text/javascript"></script>  <!-- also tested on jquery nightly 5.dec.2008 -->
		
		<!-- this <link> tag must be moved before the above <script> tag for a workaround -->
  		<link href="stylesheet.css" media="screen" rel="stylesheet" type="text/css" />

<!-- point of note; uncommenting this style block makes the bug go away
		<style>
			.box {
				width: 200;
			}
		</style>
-->

		<script>
			$(document).ready(function() 
			{
				// this output is incorrect, unless the width property is specified in the <style> block above in addition to stylesheet.css
				$("#ready").text( "ready: " + $(".box").width() );
			});
		</script>
	</head>

	<body onLoad="$('#onLoad').text( 'onLoad: ' + $('.box').width() )">  <!-- this output is correct -->

		<div class="box" id="id">
		</div>
		
		<div id="ready">
		</div>
		<div id="onLoad">
		</div>

	</body>
</html>

Download in other formats:

Original Format