问题
I currently have a site that both needs JSAPI and infieldlabels javascript. I have the following code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.infieldlabel.min.js"></script>
<? /* those three lines for my menu */ ?>
<script type="text/javascript" src="http://www.google.com/jsapi" ></script>
<script type="text/javascript" > google.load("mootools", "1.2.1"); </script>
<script type="text/javascript" src="/js/MenuMatic_0.68.3.js"></script>
<? /* INIT */ ?>
<script type="text/javascript">
$(document).ready(function(){
$("label").inFieldLabels();
});
</script>
However, the infield labels do not work. IF I remove the line with Google JSAPI, infield labels start working, but my menu breaks.
How do I make both work?
回答1:
There was some conflict, so I used the var $j = jQuery.noConflict(); described here: http://docs.jquery.com/Using_jQuery_with_Other_Libraries
来源:https://stackoverflow.com/questions/8927912/using-google-jsapi-breaks-my-infieldlabel-javascript-why-and-how-do-i-fix-it