Friday, January 13, 2006

Dynamic Frames using javascript....

For the past two days i was having a problem for a component to dynamically load the page in the specified frame and if the frame is not specified it has to be loaded in the default frame.

One of my friend and colleague Ramesh said, he will try for me as i was not an expert in javascript.

Today morning also i was a bit disappointed as it could be merely a single line answer but it breaked my head like anything.

At last i roled out my sleeves and thought of exploring myself very patiently and i got a real self confidence after reading an article in the internet about achievement. Atlast i found the answer today and it was really simple.

The document object has frames collection which cane be used to point out the required frame

document.frames[].location.href = URL

here the frameName can be passed as both Name and index.
Name refers to the name of the target frame
index referes to the index in the specified order of the frameset.

so i just passed the required frame which i have stored in the database which is another BIG story!

Thats all folks!

Thank you ramesh for you try!


No comments: