chrometweaks.org

Should I go for 1 iPage web hosting server, or 2?

Click Here To View All Answers...


My first question is Should I go for 1 iPage web hosting server, or 2? Thanks for any comment. My 2nd question... Hi guys, have a minor problem here, just wanted to know how do you write code in Javascript to open a link in a new browser window? I want the Js equivalent of HTML's "target=_blank" statement..

For example, in the following statement,.

OCMenu.makeMenu('sub73','top7',' MOPNG','http://www.petroleum.nic.in').

How do I make the link open in a new browser window?.

Thanks in advance!.

Cheers!.

PS I think this post is in the wrong forum *oops*! Anyways, I checked another forum with the same query, with answers by Dr. Web, but somehow they're not working for my code, if I try open.window or window.open, it tells me the URL is wrong... pls help! Thanks...

Comments (4)

I would like to know the answer too. Anyone here know what is the answer to that question. I'll do some research in Google and get back to you if I discover an anything. You should email the people at iPage as they probably can answer it..

Comment #1

Hi Dr. Web and mrkite,.

You're right, this is a propreitary script, gotten from dhtmlcentral. The author has written that we can use the target=_blank (basically open link in a new window) but he's not given the exact syntax. I'm pasting the code as it currently exists in my webpage, I'd really appreciate it if you could take a look. Thanks so much..

For the actual code (i.e. at dhtmlcentral), you can look at:.

Http://www.dhtmlcentral.com/coolmenu...mes/menu1.html.

Code used in my page:.

<SCRIPT language=JavaScript1.2 src="botmenu_files/coolmenus3.js">.

/Copyright 2001 Thomas Brattli (.

Www.bratta.com.

)Version 3.02/.

</SCRIPT>.

<SCRIPT>.

/Default browsercheck/.

Function lib_bwcheck(){.

This.ver=navigator.appVersion; this.agent=navigator.userAgent.

This.dom=document.getElementById?1:0.

This.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;.

This.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;.

This.ie4=(document.all && !this.dom)?1:0;.

This.ie=this.ie4||this.ie5||this.ie6.

This.mac=this.agent.indexOf("Mac")>-1.

This.opera5=this.agent.indexOf("Opera 5")>-1.

This.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;.

This.ns4=(document.layers && !this.dom)?1:0;.

This.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom).

Return this.

}.

Var bw=new lib_bwcheck().

Var mDebugging=2.

OCMenu=new makeCoolMenu("oCMenu").

OCMenu.useframes=0.

OCMenu.frame="frmMain".

OCMenu.useclick=0.

OCMenu.useNS4links=1.

OCMenu.NS4padding=2.

OCMenu.checkselect=0.

OCMenu.offlineUrl="file:///C|/program files/munaiprograms/munaifiles/web development/ongc/ongcindia/".

OCMenu.onlineUrl="http://www.ongcindia.com".

OCMenu.pagecheck=1.

OCMenu.checkscroll= 0.

OCMenu.resizecheck=1.

OCMenu.wait=700.

//Background bar properties.

OCMenu.usebar=1.

OCMenu.barcolor="#FFffff".

OCMenu.barwidth="menu".

OCMenu.barheight="menu".

OCMenu.barx="menu".

OCMenu.bary="menu".

OCMenu.barinheritborder=0.

//Placement properties.

OCMenu.rows=1.

OCMenu.fromleft=52.

OCMenu.fromtop=27.

OCMenu.pxbetween=1.

OCMenu.menuplacement="0".

/*.

Level[0] = top items.

Level[1] = sub items.

*/.

OCMenu.level[0]=new Array().

OCMenu.level[0].width=103.

OCMenu.level[0].height=15.

OCMenu.level[0].bgcoloroff="#F1EFAE".

OCMenu.level[0].bgcoloron="#C23600".

OCMenu.level[0].textcolor="#000000".

OCMenu.level[0].hovercolor="#E8CE7E".

OCMenu.level[0].style="padding:0px; font-family:verdana,arial,helvetica; font-size:10px; font-weight:normal".

OCMenu.level[0].border=0.

OCMenu.level[0].bordercolor="white".

OCMenu.level[0].offsetX=-1 //The X offset of the submenus of this item..

OCMenu.level[0].offsetY=0 //The Y offset of the submenus of this item..

OCMenu.level[0].NS4font="verdana,arial,helvetica".

OCMenu.level[0].NS4fontSize="1".

OCMenu.level[0].align="top".

OCMenu.level[0].slide=1.

OCMenu.level[1]=new Array().

OCMenu.level[1].width=oCMenu.level[0].width.

OCMenu.level[1].height=17.

OCMenu.level[1].bgcoloroff="#F1EFAE".

OCMenu.level[1].bgcoloron="#E8CE7E".

OCMenu.level[1].hovercolor="#C23600".

OCMenu.level[1].style="padding:2px; font-family:verdana, arial,helvetica; font-size:10px; font-weight:normal".

OCMenu.level[1].align="center".

OCMenu.level[1].offsetX=0.

OCMenu.level[1].offsetY=0.

OCMenu.level[1].border=1.

OCMenu.level[1].bordercolor="white".

OCMenu.makeMenu('top0','','&nbsp;Our Company').

OCMenu.makeMenu('sub00','top0','&nbsp;Overview','about/overview.htm').

OCMenu.makeMenu('sub01','top0','&nbsp;Departments','about/departments.htm').

OCMenu.makeMenu('sub02','top0','&nbsp;The Board','about/board.htm').

OCMenu.makeMenu('sub03','top0','&nbsp;Initiatives','about/initiatives.htm').

OCMenu.makeMenu('sub04','top0','&nbsp;Corporate &nbsp;Governance','about/corpgov.htm',103,103,30).

OCMenu.makeMenu('sub05','top0','&nbsp;Navaratna','about/navaratna.htm').

OCMenu.makeMenu('sub06','top0','&nbsp;Accreditations','about/accreditations.htm').

OCMenu.makeMenu('top1','','&nbsp;Our Business').

OCMenu.makeMenu('sub10','top1','&nbsp;Exploration','business/exploration.htm').

OCMenu.makeMenu('sub11','top1','&nbsp;Drilling','business/drilling.htm').

OCMenu.makeMenu('sub12','top1','&nbsp;Products','business/products.htm').

OCMenu.makeMenu('sub13','top1','&nbsp;Resources','business/resources.htm').

OCMenu.makeMenu('sub14','top1','&nbsp;Locations','business/locations.htm').

OCMenu.makeMenu('sub15','top1','&nbsp;R & D','business/research.htm').

OCMenu.makeMenu('top2','','&nbsp;Our Concerns').

OCMenu.makeMenu('sub20','top2','&nbsp;Energy','concerns/energy.htm').

OCMenu.makeMenu('sub21','top2','&nbsp;Environment','/concerns/environment.htm').

OCMenu.makeMenu('sub22','top2','&nbsp;Community','concerns/community.htm').

OCMenu.makeMenu('sub23','top2','&nbsp;India','concerns/india.htm').

OCMenu.makeMenu('sub24','top2','&nbsp;Global Issues','concerns/global.htm').

OCMenu.makeMenu('top3','','&nbsp;Investors').

OCMenu.makeMenu('sub30','top3','&nbsp;News','investors/news.htm').

OCMenu.makeMenu('sub31','top3','&nbsp;Financials','investors/financials.htm').

OCMenu.makeMenu('sub32','top3','&nbsp;Key Issues','investors/keyissues.htm').

OCMenu.makeMenu('sub33','top3','&nbsp;Shareholders','investors/shareholders.htm').

OCMenu.makeMenu('sub34','top3','&nbsp;Strategic Plans','investors/strategicplans.htm').

OCMenu.makeMenu('sub35','top3','&nbsp;Calendar','investors/calendar.htm').

OCMenu.makeMenu('top5','','&nbsp;News').

OCMenu.makeMenu('sub50','top5','&nbsp;News This Week','news/weeknews.htm').

OCMenu.makeMenu('sub51','top5','&nbsp;Press Releases','news/pressrelease.htm').

OCMenu.makeMenu('sub52','top5','&nbsp;Archives','news/archives.htm').

OCMenu.makeMenu('sub53','top5','&nbsp;ONGC Magazines','news/magazines.htm').

OCMenu.makeMenu('top6','','&nbsp;Interactive').

OCMenu.makeMenu('sub60','top6','&nbsp;Opinion Poll','poll.asp').

OCMenu.makeMenu('sub61','top6','&nbsp;Message Board','msgboard/msgboard.asp').

OCMenu.makeMenu('sub62','top6','&nbsp;Your Articles','submitarticle.asp').

OCMenu.makeMenu('sub63','top6','&nbsp;Your Comments','submitcomment.asp').

OCMenu.makeMenu('sub64','top6','&nbsp;Login','login.asp').

OCMenu.makeMenu('sub65','top6','&nbsp;Sign Up','register.asp').

OCMenu.makeMenu('top7','','&nbsp;Related Sites').

OCMenu.makeMenu('sub70','top7','&nbsp;ONGC Videsh','http://www.ongcvidesh.com').

OCMenu.makeMenu('sub71','top7','&nbsp;ONGC Reports','http://www.ongcreports.net').

OCMenu.makeMenu('sub72','top7','&nbsp;ONGC Tenders','http://www.ongctenders.com').

OCMenu.makeMenu('sub73','top7','&nbsp;MOPNG','http://www.petroleum.nic.in').

OCMenu.makeMenu('sub74','top7','&nbsp;OCC','http://64.225.65.191/petrotech2001/industry/occ.htm').

OCMenu.makeMenu('sub75','top7','&nbsp;Petrotech','http://64.225.65.191/petrotech2001/index.htm').

//Making the styles and then constructing the menu.

OCMenu.makeStyle(); oCMenu.construct().

</SCRIPT>..

Comment #2

Hey,.

Can you please post the contents of.

Coolmenus3.js.

?.

The author has set this up so that you just need to make a small change to his already written script...

Comment #3

Just a hint: I downloaded, unzipped, and opened the menu file in my editor, typed "_blank" in a find box, and got to the function in question; you should be doing this!.

Here's the poop: the first five arguments to the function cm_makeMenu - which becomes the.

MakeMenu.

Method - are (name,parent,text,link,target,...) - if you use.

_blank.

As the fifth parameter:.

OCMenu.makeMenu('sub73','top7',' MOPNG','http://www.petroleum.nic.in','_blank').

...you'll get a blank window. Here's the code that does it:.

Function cm_go(name){.

Obj=this.m[name]; url=obj.lnk;.

Target=obj.target.

; fc=obj.mclick.

If(url){.

If(.........

............

}.

Else if(target=="_blank") window.open(url).

...just fyi. This opens a window in the default configuration; not very sophisticated for such a lengthy program. Want something better?.

Function cm_go(name){.

Obj=this.m[name]; url=obj.lnk; target=obj.target; fc=obj.mclick.

If(url){.

If(this.useframes&&!coolFrameError) loc=this.win.location.href; else loc=location.href.

If(fc) eval(fc); url=this.checkFolder(loc.toString(),url); this.isover=0;.

This.hideSubs(1,0,1); this.isclicked=0; this.aobj[0]=-1.

If(String(target)=="undefined" || target=="" || target==0 || target=="_self"){.

This.win.location.href=url.

}.

Else if(target=="custom") popUp(url).

;.

Else if(target=="_top" || target=="window") top.location.href=url.

Else if(top[target]) top[target].location.href=url.

Else{fr=findFrame(target); if(fr) fr.location.href=url}.

}else if(fc) eval(fc).

}.

...and.

OCMenu.makeMenu('sub73','top7',' MOPNG','http://www.petroleum.nic.in','custom').

This assumes you pasted the above.

PopUp().

Function in somewhere...

Comment #4

... but THANKS! It works like a charm, but I really want to say that I truly appreciate all the effort Dr. Web and mrkite have put into this, with all the additional info. Cool of you, guys, you've got one more ardent disciple :O).

Thanks again,.

Cheers!..

Comment #5


This question was taken from a support group/message board and re-posted here so others can learn from it.