I'm trying to get my menu to work with an iFrame, but I keep getting a JS error telling me that...
Error: 'idId.location' is Null or not an Object
What am I doing wrong? Below is my code.
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
function openIFrame(IFrameID, URL){
ifId=gmobj(IFrameID)
ifId.location.href=URL // Opera Bug Fix. ifId.src=URL
}
</script>
<SCRIPT language=JavaScript src="menu_data_forum.js" type=text/javascript>
<iframe name="calFrame" id="calFrame" src="http://www.google.com" frameborder="1" border="0" scrolling="auto" width="540" height="700">
<b>Your browser does not support iFrames</b>
</iframe>
// BEGIN: calendar menu for MS 1's
with(milonic=new menuname("calendarmainMS1")){
style=menuStyle;
overflow="scroll";
margin=2;
aI("text=Main;url=index.cfm?curpage=newcalendars&c=ms 1;");
aI("text=Core Course Calendar (default);showmenu=corecourseMS1;");
aI("text=Student Life Calendar;showmenu=studentlifeMS1;");
}
// BEGIN: core coure calendars for MS 1's
with(milonic=new menuname("corecourseMS1")){
style=menuStyle;
overflow="scroll";
margin=2;
aI("text=1 Open in Frame;url=javascript:openIFrame('calFrame,'http://ucsd.edu/command.shtml?'');image=images/same_window.gif;target=calFrame;");
aI("text=Open in New Window;url=http://ucsd.edu/command.shtml?;image=im ... arget=_new;");
// copied from milonic examples
aI("text=Open Google in IFrame;url=javascript:openIFrame('calFrame','http://www.google.com')");
aI("text=Apache Web Server;url=javascript:openIFrame('calFrame','http://www.apache.org/');;status=Apache Web Server, the basis of Milonic's Web Site;");
}
JS Error, ifId.location is null or not an object
Your quotes are all messed up here this should sayurl=javascript:openIFrame('calFrame,'http://ucsd.edu/command.shtml?'');
Code: Select all
url=javascript:openIFrame('calFrame','http://ucsd.edu/command.shtml?');
Dave Hergert
Software Engineer
"Helping to make the menu better, one
at a time."
Software Engineer
"Helping to make the menu better, one
