CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 What Am I doing wrong now :-(

Print topic Send  topic

Author Message
acapp


Posts: 31
Posted: 05/18/2004, 7:57 PM

I want to put this javascript menu code into my header. I see it in the preview of CCS, but on the actual site nothing appears. The source is there, but nothing is happening. JavaScript is automatically created by Coffee Cup DHTML.

I made the header file includable and put this script in there, There is nothing else in the HTML area of the page.

Does somebody know what I'm doing wrong this time.

TIA
Andrew

<script type='text/javascript'>

function Go(){return}

/***********************************************************************
YOU CAN MANUALLY CHANGE THE MENU HERE, BUT BE VERY CAREFUL !
***********************************************************************/

Menu1=new Array("Courses","","",4,20,80);
Menu1_1=new Array("List Courses","http://localhost/Users/training_list.cpp","",0,20,80);
Menu1_2=new Array("Add New Course","http://localhost/Users/training_maint_new.ccp","",0,20,80);
Menu1_3=new Array("QMS Print","http://localhost/Users/qms_friendly.ccp","",0,20,80);
Menu1_4=new Array("Legend","http://localhost/Users/legend.ccp","",0,20,80);

Menu2=new Array("Request","","",1,20,80);
Menu2_1=new Array("Training Request","http://localhost/Users/training_request_list.ccp","",0,20,80);

Menu3=new Array("Account","","",1,0,80);
Menu3_1=new Array("Modify Account","http://localhost/Users/user_info.ccp","",0,20,80);

Menu4=new Array("Logout","http://localhost/logout.ccp","",0,20,80);


var NoOffFirstLineMenus=4; // Number of first level items
var LowBgColor='FFE74A'; // Background color when mouse is not over
var LowSubBgColor='D62121'; // Background color when mouse is not over on subs
var HighBgColor='FFE74A'; // Background color when mouse is over
var HighSubBgColor='5A4ABD'; // Background color when mouse is over on subs
var FontLowColor='000000'; // Font color when mouse is not over
var FontSubLowColor='FFFFFF'; // Font color subs when mouse is not over
var FontHighColor='5A4ABD'; // Font color when mouse is over
var FontSubHighColor='FFFFFF'; // Font color subs when mouse is over
var BorderColor='FFFFFF'; // Border color
var BorderSubColor='FFFFFF'; // Border color for subs
var BorderWidth=1; // Border width
var BorderBtwnElmnts=1; // Border between elements 1 or 0
var FontFamily="Arial,Tahoma, Verdana," // Font family menu items
var FontSize=10; // Font size menu items
var FontBold=0; // Bold menu items 1 or 0
var FontItalic=0; // Italic menu items 1 or 0
var MenuTextCentered='left'; // Item text position 'left', 'center' or 'right'
var MenuCentered='left'; // Menu horizontal position 'left', 'center' or 'right'
var MenuVerticalCentered='static'; // Menu vertical position 'top', 'middle','bottom' or static
var ChildOverlap=.2; // horizontal overlap child/ parent
var ChildVerticalOverlap=.2; // vertical overlap child/ parent
var StartTop=80; // Menu offset x coordinate
var StartLeft=15; // Menu offset y coordinate
var VerCorrect=0; // Multiple frames y correction
var HorCorrect=0; // Multiple frames x correction
var LeftPaddng=3; // Left padding
var TopPaddng=2; // Top padding
var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
var MenuFramesVertical=1; // Frames in cols or rows 1 or 0
var DissapearDelay=1000; // delay before menu folds in
var TakeOverBgColor=1; // Menu frame takes over background color subitem frame
var FirstLineFrame='navig'; // Frame where first level appears
var SecLineFrame='space'; // Frame where sub levels appear
var DocTargetFrame='space'; // Frame where target documents appear
var TargetLoc=''; // span id for relative positioning
var HideTop=0; // Hide first level when loading new document 1 or 0
var MenuWrap=1; // enables/ disables menu wrap 1 or 0
var RightToLeft=0; // enables/ disables right to left unfold 1 or 0
var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover
var WebMasterCheck=0; // menu tree checking on or off 1 or 0
var ShowArrow=1; // Uses arrow gifs when 1
var KeepHilite=1; // Keep selected path highligthed
var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height


/***********************************************************************
DO NOT EDIT ANYTHING BELOW THIS LINE - IT WILL BREAK THE SCRIPT !
***********************************************************************/

var AgntUsr=navigator.userAgent.toLowerCase();
var DomYes=document.getElementById?1:0;
var NavYes=AgntUsr.indexOf('mozilla')!=-1&&AgntUsr.indexOf('compatible')==-1?1:0;
var ExpYes=AgntUsr.indexOf('msie')!=-1?1:0;
var Opr=AgntUsr.indexOf('opera')!=-1?1:0;
var Opr6orless=window.opera && navigator.userAgent.search(/opera.[1-6]/i)!=-1 //DynamicDrive.com added code
var DomNav=DomYes&&NavYes?1:0;
var DomExp=DomYes&&ExpYes?1:0;
var Nav4=NavYes&&!DomYes&&document.layers?1:0;
var Exp4=ExpYes&&!DomYes&&document.all?1:0;
var PosStrt=(NavYes||ExpYes)&&!Opr6orless?1:0;
var FrstLoc,ScLoc,DcLoc;
var ScWinWdth,ScWinHght,FrstWinWdth,FrstWinHght;
var ScLdAgainWin;
var FirstColPos,SecColPos,DocColPos;
var RcrsLvl=0;
var FrstCreat=1,Loadd=0,Creatd=0,IniFlg,AcrssFrms=1;
var FrstCntnr=null,CurrntOvr=null,CloseTmr=null;
var CntrTxt,TxtClose,ImgStr;
var Ztop=100;
var ShwFlg=0;
var M_StrtTp=StartTop,M_StrtLft=StartLeft;
var StaticPos=0;
var LftXtra=DomNav&&!Opr?LeftPaddng:0; //Changed for Opera
var TpXtra=DomNav?TopPaddng:0;
var M_Hide=Nav4?'hide':'hidden';
var M_Show=Nav4?'show':'visible';
var Par=parent.frames[0]&&FirstLineFrame!=SecLineFrame?parent:window;
var Doc=Par.document;
var Bod=Doc.body;
var Trigger=NavYes&&!Opr?Par:Bod; //Changed for Opera

MenuTextCentered=MenuTextCentered==1||MenuTextCentered=='center'?'center':MenuTextCentered==0||MenuTextCentered!='right'?'left':'right';
WbMstrAlrts=["Item not defined: ","Item needs height: ","Item needs width: "];

if(Trigger.onload)Dummy=Trigger.onload;
if(DomNav||Opr)Trigger.addEventListener('load',Go,false); //Changed for Opera
else Trigger.onload=Go;

-----------------------snipped for brevity ------------------------------------

Wdth=RcrsLvl==1&&FirstLineHorizontal?eval(WMnu+'[5]')?eval(WMnu+'[5]'):MenuWidth:MenuWidth;
Hght=RcrsLvl==1&&FirstLineHorizontal?MenuHeight:eval(WMnu+'[4]')?eval(WMnu+'[4]'):MenuHeight;
if(DomYes){
Mbr=Location.document.createElement("div");
Mbr.style.position='absolute';
Mbr.style.visibility='inherit';
MmbrCntnr.appendChild(Mbr)}
else Mbr=Nav4?new Layer(Wdth,MmbrCntnr):Location.document.all[WMnu];
Mbr.SetUp=Nav4?NavMbrSetUp:MbrSetUp;
Mbr.SetUp(MmbrCntnr,PrvMmbr,WMnu,Wdth,Hght);
if(NoOffSubs) Mbr.ChildCntnr=CreateMenuStructure(WMnu+'_',NoOffSubs);
PrvMmbr=Mbr}
MmbrCntnr.FrstMbr=Mbr;
RcrsLvl--;
return(MmbrCntnr)}

function CreateMenuStructureAgain(MName,NumberOf){
var i,WMnu,NoOffSubs,PrvMmbr,Mbr=FrstCntnr.FrstMbr;
RcrsLvl++;
for(i=NumberOf;i>0;i--){
WMnu=MName+eval(i);
NoOffSubs=eval(WMnu+'[3]');
PrvMmbr=Mbr;
if(NoOffSubs)Mbr.ChildCntnr=CreateMenuStructure(WMnu+'_',NoOffSubs);
Mbr=Mbr.PrvMbr}
RcrsLvl--}

function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

</script>
<noscript>Your browser does not support script</noscript>

<!-- REST OF BODY CONTENT BELOW HERE -->
View profile  Send private message
bguthrie


Posts: 31
Posted: 05/19/2004, 6:23 AM

I too had the same results with a DHTML Menu created with Cofffee Cup. I tried resolving this with CCS Tech Support but we were never able to get it to work. It's really strange how things worked in preview mode but not when running the web page directly. Beacause of time constraints, I ended up using the "Tigra Menu Online Builder" located at www.softcomplex.com (this is free, but you can also purchase a downloadable product if you'd like) to create DHTML Menus and everything worked without a hitch (you can modify the generated javascript). At this point I'm not sure if the issue is in Coffee Cup's DHTML menu, CCS or both.

I hope this helps.
_________________
Regards,

Bruce
View profile  Send private message
acapp


Posts: 31
Posted: 05/19/2004, 7:17 PM

Hi Bruce,

I've tried some other programs as well. Tigra Menu Builder as well. I'm still not getting anywhere. Is there an example of how to add JavaScript to a Header file to make dynamic menus for CCS. I've looked in the documentation with no success. I've searched this site as well.

Thanks
Andrew
View profile  Send private message
acapp


Posts: 31
Posted: 05/20/2004, 5:45 AM

I have been thinking that running a javascript in the header should be as easy as cut and paste of the script and putting it into the html area of the header?

Is this not correct? This method seems to work on my laptop when I'm developing it, but not on my server when I ftp it up.

Any suggestions would be appreciated.
Andrew
View profile  Send private message
klwillis


Posts: 428
Posted: 05/20/2004, 9:15 AM

So, adding this code within the CCS HTML source file directly in
the header doesn't work? That seems strange. :-/
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
peterr


Posts: 5971
Posted: 05/20/2004, 11:33 AM

JavaScript should work exactly as easily. If it works on one computer and not another then compare the HTML source of both pages to see what could be wrong.
Contact our support if you need technical help.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
bguthrie


Posts: 31
Posted: 05/21/2004, 6:22 AM

Here is the code I have inserted in my HTML Header page using the Tigra menu:

<link href="menu.css" rel="stylesheet">
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menu_items.js"></script>
<script language="JavaScript" src="menu_tpl.js"></script>
<script language="JavaScript">
<!--//
new menu (MENU_ITEMS, MENU_POS, MENU_STYLES);
//-->
</script>

This page is setup as an "Included" page and used by every other page in the project.

_________________
Regards,

Bruce
View profile  Send private message
acapp


Posts: 31
Posted: 05/21/2004, 7:56 AM

Ok,

Thanks everyone, I've got this working now. Even with Coffee Cup.

I appreciate your help.

Andrew
View profile  Send private message
DonB
Posted: 06/22/2004, 7:42 AM

Are you going to tell us what fixed it for you?

--
DonB

http://www.gotodon.com/ccbth


"acapp" <acapp@forum.codecharge> wrote in message
news:540ae18a68ed3c@news.codecharge.com...
> Ok,
>
> Thanks everyone, I've got this working now. Even with Coffee Cup.
>
> I appreciate your help.
>
> Andrew
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Carver6
Posted: 09/17/2004, 1:31 AM

I am just jumping into this CCS stuff but I may have some input. The Javascript source links need to be in the header of the web page. I noticed something strange when looking at CSS. The "Header" that is created in CSS (and included in most pages with a footer) is actually a "masthead" (CONFUSING!). Originally this made me think the "Header" file was part of the <head> </head> (or header) part of the page where the Javascript file references would need to be for this type of Javascript code to load, but it appears not to be.

Sooooo... I read somewhere there is a template file.Would that file have the
<head> </head> 
tags? If so, put the all the above code into the template page. That way its included in all pages. Then create a file with the code that calls the function Go() and make it "includable = yes" . Import the includable page where ever you want the menu to appear. You could also put Go() into the "Header" file to make it appear at the top of your pages.

If it works, please let us know!

acapp


Posts: 31
Posted: 09/17/2004, 7:29 AM

Hi,

I'm sorry I didn't post the answer. Now I've forgotten it all these months later. I'' see what I can do to find it.

Andrew
View profile  Send private message
acapp


Posts: 31
Posted: 09/28/2004, 11:15 AM

Hi, This is what I did to get my DHTML menus to work with CCS. At the top of the file in HTML I added a path to a src. This was the only way I could get the scripts to run. I could not get them to run by just a paste of the code in to the my page, I always have to refer to it as a script and point to it.

<html>
<head>
</head>
<script language="JavaScript" type='text/javascript' src='../Scripts/supermenu.js'></script>
<noscript>Your browser does not support script</noscript>
<body>
</body>
</html>

Hope this helps somebody in the future.

Andrew
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.