View Full Version : AnyLink Drop Down Menu & IFrame SSI script II

01-29-2006, 08:54 PM

I'm trying to open an external page using the IFrame SSI script II (http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm) with a link inside of a drop down menu (http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm).

If I want to open an external page from a link on my main page, I should use the following code.

<a href="javascript:loadintoIframe('myframe', 'external.htm')">Link</a>

That works great! HOWEVER, when I want to open an external page from a link in A PULL DOWN MENU from my main page it does not work. Here's an example of the code I'm using.

menu1[0]='<a href="javascript:loadintoIframe('myframe', 'alumni/directory.html')">Directory</a>'

I guess I'm using my " and ' in the wrong places.

01-30-2006, 08:08 AM
menu1[0]='<a href="javascript:loadintoIframe(\'myframe\', \'alumni/directory.html\')">Directory</a>'


menu1[0]='<a href=javascript:loadintoIframe("myframe","alumni/directory.html") >Directory</a>'

Either should work. The first is better, as the second will break if spaces are introduced in the wrong places, more so than the first will. The idea being that if you are using ' to delimit the string for the variable menu1[0], you must escape (\) it's use inside the string.

01-30-2006, 08:45 PM
Works like a charm. Thanks so much!