Desidero includere il file jquery nel file, se non è già incluso nella pagina. Come posso fare questo?Include jQuery, se non incluso già
Ho scritto questo, ma sta dando un risultato indesiderato.
<script type="text/javascript">
if ('undefined' == typeof window.jQuery) {
// jQuery not present
// alert("Jquery Unavailable");
<?php echo '<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>'; ?>
} else {
// jQuery present
alert("Jquery Available");
}
</script>
correlati: http://stackoverflow.com/questions/6787569/best-way-to-avoid-including-stylesheets-external-js-more-than-once-in-a- page –