Insert invisible frame at will
Ever thought of inseting a "hidden" frame in your page, where you can do magical things? Well we all do. Invisible frame is the magic wand for java developers. Well, now you can keep your source(html, jsp, jsf, etc) clean and insert this frame with a function call.
Code below will not only insert a invisible frame, but it will also return you its handle. If you wish you can pass a frame id of your choice, or be careless and the code will generate one.
/*
*Add a invisible frame in your document and get a handle to it.
*It is not necessary to specify the frame id.
*/
var frameCount = 0;
function getInvisibleFrameHandle(frameId)
{
var frameName,html;
if (!frameId)
frameName="_invisibleFrame__" + (frameCount++);
else
frameName = frameId;
if (document.getElementById(frameName))
return document.frames[frameName];
else
appendDocument("
0 Comments:
Post a Comment
<< Home