I’m am trying to get jlembed to work but I constantly get errors in chrome debugger. I tried all of THIS solutions but had no luck. Which is the correct way to include jquery and jquery-plugin? Because I tried putting jQuery first, last.
Here is one of my src code versions:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="jquery.jlembed.js"></script>
<script language="javascript" type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
$("#playerDiv").jlEmbed({ //here is the error (debugger)
id : 'player1',
youtube : 'Cw2HAD9A_rw',
format : 'swfobject',
autoplay : 'no',
youtubechromeless : 'no',
youtubedisplay : true
});
});
</script>
and ther error:
Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function
(anonymous function)
jQuery.jQuery.extend.readyjquery-latest.js:447
jQuery.DOMContentLoaded
EDIT2: Answer:
I found the correct syntax based on THIS.
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="jquery.jlembed.js"></script>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function(){
//jQuery("").hide();
});
jQuery(document).ready(function(){
$("#playerDiv").jlEmbed({
id : 'player1',
youtube : 'Cw2HAD9A_rw',
format : 'swfobject',
autoplay : 'no',
youtubechromeless : 'no',
youtubedisplay : true
});
});
</script>
Why do you call noConflict. then use jQuery as the document ready. and then use the normal $ jquery selector once again on $(“#playerDiv”)/
try changing that $ to jQuery as well.