Seeding the openIFrame function with initial values

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Paul Ciarelli
Beginner
Beginner
Posts: 2
Joined: Sun Sep 28, 2003 10:59 pm

Seeding the openIFrame function with initial values

Post by Paul Ciarelli »

I'm using an iframe on a site that I'm developing and I have it working fine except for one thing. When you first go into the site, the iframe is blank (as it is in DHTML Menu sample number 11 Opening Windows & Frames)

Here is the script:

<script>
function openIFrame(iFrameId,winURL)
{
ifId=gmobj(iFrameId)
ifId.src=winURL
}

</script>

How do I seed iFrameId and winURL with inital values so that the iframe is populated when initially going into the site.

BTY, yes I'm a rookie. :?
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Iframes have a value in themselves to specify their URL. When you put them in your page you can specify it then. All the function is then doing is taking that value and changing it. Heres the code for an iframe to initially come up on your page with google in it, then your menu can update it as usual.

Code: Select all

<iframe src="http://www.google.com" width="700" height="400" id="myiframe" name="myiframe"></iframe>
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Paul Ciarelli
Beginner
Beginner
Posts: 2
Joined: Sun Sep 28, 2003 10:59 pm

Post by Paul Ciarelli »

Out of all the things I tried.....

Thanks Hergio, You Da Tech!
Post Reply