[OpenLayers-Users] jQuery/OpenLayers-2.8 conflict

AlessioDL alessio.dilorenzo at gmail.com
Sat Jan 30 09:50:23 EST 2010


Hi list, 
http://faq.openlayers.org/misc/why-doesnt-openlayers-work-with-jquery/ This 
page tells that the conflict issue between jQuery/OL "is fixed by default in
release 2.8 and later".

Probably I'm doing something wrong, but it seems that it is not true for
Firefox.

This is my code (very simple):

<html>
	<head>
		<title>jQuery | OpenLayers</title>
		
		<!-- OpenLayers -->
		<script type="text/javascript"
src="JsLib/OpenLayers-2.8/lib/OpenLayers.js" />
				
		<!-- jQuery UI -->
		<link type="text/css"
href="JsLib/jquery-ui-1.7.2.custom/css/humanity/jquery-ui-1.7.2.custom.css"
rel="Stylesheet" /><br>
		<script type="text/javascript"
src="JsLib/jquery-ui-1.7.2.custom/js/jquery-1.3.2.min.js"></script><br>
		<script type="text/javascript"
src="JsLib/jquery-ui-1.7.2.custom/js/jquery-ui-1.7.2.custom.min.js"></script>
		
		<script type="text/javascript">
			
			$(document).ready(function()
			{
				$("#accordion").accordion({animated:'bounceslide'});
			});
		</script>
		
		<script type="text/javascript">
			var map = new OpenLayers.Map('map');
		</script>

	</head>
	<body>
		<div id="map">
		</div>
		
		<div id="accordion">
			<h3> # Pannello A </h3>
    		        <div>...</div>
    		        <h3> # Pannello B </h3>
    		       <div>...</div>
		</div>
	</body>
</html>

This code works for Safari and Chrome, but not for Firefox (3.6). 
Firebug reports me 2 errors:
jQuery is not defined
$(document).ready is not a function
-- 
View this message in context: http://n2.nabble.com/jQuery-OpenLayers-2-8-conflict-tp4485516p4485516.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list