I am trying to pass one variable to a jQuery function inline (ie: using an onMouseOver="function();"
within the actual link (which is an area tag from an image map)).
The function is only being called if I place it before the $(document).ready(function(){
line, but doing this is causing all sorts of problems with jQuery.
All I want is for a simple tag (such as <area shape="circle" coords="357,138,17" onMouseOver="change('5');" id="5" />
to launch a function that is contained within the normal jQuery body of code.
Many thanks for any help you can offer.
To illustrate the point, the following works:
<script type="text/javascript">
function myfunction(x) { alert(x); //Alerts 2
}
</script>
<img src="/shared_images/loading.gif" border="0" usemap="#Map">
<map name="Map"><area shape="rect" coords="171,115,516,227"
onMouseOver="myfunction('2')"></map>
But the following doesn't
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function myfunction(x) { alert(x); //Nothing happens
}
}
</script>
<img src="/shared_images/loading.gif" border="0" usemap="#Map">
<map name="Map"><area shape="rect" coords="171,115,516,227"
onMouseOver="myfunction('2')"></map>