Targeting an iFrame once with jQuery
- by user275074
Hi,
I have a series of frames (4) which are used in a page to create loading of dynamic content through Ajax calls.
In each of these frames I target parent level elements and update them with there respective content e.g.
$("#loadingGrid1",top.document).show();
$("#frameSkills",top.document).hide();
In jQuery is there a way to instead of targeting specific elements on the parent page multiple times, simply target the page once into a variable e.g. var parentPage=$('#frameSkills',top.document);
And then use this variable to apply content like $(parentPage #loadingGrid1).hide()
Hope I've explained what I'm after enough. Basically, I'm having to call "top.document" in every jQuery selector I make and it seems like a waste of energy.