I am trying to create an iframe login widget that can be used on a customers website. This iframe will use jQuery, but at first I wonβt be able to check if the jQuery source document is loaded, if not, download it.
I tried several different methods, but none of them work, or decided to download the jQuery library twice.
Any help would be greatly appreciated.
This code block is inside a page loaded inside an iframe that refuses to cooperate.
<script> var jQOutput = false; function initjQuery() { if (typeof(jQuery) == 'undefined'){ if (!jQOutput){ jQOutput = true; var jScript = document.createElement('script'); jScript.setAttribute("type", "text/javascript"); jScript.setAttribute("src", "js/libs/jquery/jquery-min.js"); } setTimeout("initjQuery()", 50); } else { $(function() { $("#email").css({"background":"red"}); </script>
I just want to check and see if the parent has loaded jQuery in the iframe, and if not, download it yourself, since I will use it to perform several tasks necessary to complete the login procedure.
source share