I am experiencing an issue with my colorbox.js file and JavaScript code. The current setup is as follows:
echo '<script src="js/jquery.colorbox.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$("#iframe").colorbox({iframe:true, width: "830", height: "620"});
});
</script>';
echo '<a href="prices.php" id="iframe">see the pricelist</a>';
Whenever I click on a link, it opens as an iframe popup through colorbox. However, if I click on it before the page is fully loaded, it opens as a normal link in a new page instead of popping up as an iframe. My question is how can I ensure that the colorbox script loads first priority, before any other JavaScript files, to prevent it from opening as a normal page?
Thank you.