Using Google JSAPI breaks my infieldlabel javascript, why and how do I fix it?

天大地大妈咪最大 提交于 2020-01-07 00:35:25

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!