Loading jquery after inserting the jquery tag
<p>I insert the jquery tag</p>

<pre><code>    var newScript = document.createElement("script");
        newScript.id = "grazit_jq";
        newScript.type = "text/javascript"           
        newScript.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
        script.parentNode.appendChild(newScript);
</code></pre>

<p>And after that I want to check if jquery exists.</p>

<p>I do so in a few ways.One way is like this:</p>

<pre><code>     var checkJquery=function(){
        if(typeof(jQuery) === 'undefined')
        {
           console.log('jQuery doesnt exist');
            window.setTimeout(arguments.callee,1000);
            return;
        }
        else{
        sprk_lib=new sprk();
           sprk_lib.load(jQuery);
        }
    };
  sprk.prototype.load=function($){


 console.log($);
</code></pre>

<p>};
        <strong>UPDATE</strong>
Now i updated the code. It will call the function as soon as the jQuery object is availeable.</p>

<p>In that function I will execute my jquery code. Do you think that there will be problems? is it okay to do it that way? </p>

<blockquote>
  <p>original</p>
</blockquote>

<p>I wait there. problem is that in the console log , it returns null and the prints jQuery exists. How can I stop the script till the jquery is loaded,, and then continue executing the script?</p>
