Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:58

JS Error, ifId.location is null or not an object


Poster: jbreslow
Dated: Wednesday November 5 2003 - 16:15:26 GMT

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=images/new_window_menu.gif;target=_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;");
}


Poster: Hergio
Dated: Wednesday November 5 2003 - 21:03:25 GMT

Quote:
url=javascript:openIFrame('calFrame,'http://ucsd.edu/command.shtml?'');

Your quotes are all messed up here this should say
Code:
url=javascript:openIFrame('calFrame','http://ucsd.edu/command.shtml?');

The calFrame should be surrounded by a single quote on either side, and same for the ucsd Url.