So, you may have some pages (in the same domain) that always are going to be loaded as iframes. But if you have jQuery loaded in the parent document and you want to use it INSIDE the iframe (a script tag inside) you just have to do this:
var $ = function(a,b){
b = b || document;
return parent.jQuery.apply(this,[a,b])
};
But that is only if you are not going to use document.ready or any of its shortcuts. If you want to use any of those there is a workaround (Note: The iframe needs to have an id)
var $ = function(a,b){
var that = this;
b = b || document;
function ready(a){
parent.jQuery("#"+window.frameElement.id).load(function(){a.call(that)})
}
if(typeof a == "function"){
ready(a)
} else {
var r = parent.jQuery.apply(this,[a,b]);
r.ready = ready;
return r
}
};
So now you can write jQuery like it was loaded naturally inside the iframe (using the dollar sign)