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:04

Error with converted menus


Poster: simongdawson
Dated: Sunday October 12 2003 - 7:07:00 BST

My converted menus (menu_data_1.js and menu_data_2.js) both give the
same error message:

Line: 12
Char: 6
Error: Syntax Error
Code: 0
URL: <http://www.the-limes.com/milonic5_test.html>

and neither of the menus display.

The menus worked perfectly in v3. I then used the menu converter on the Milonic site to convert them to v5 and added the relevant additional files to my website. All of the milonic menu files (both v3 and v5) are located on my website in the directory http://www.the-limes.com/java/

Can anyone tell me how to correct this, please?


Poster: Maz
Dated: Sunday October 12 2003 - 9:27:29 BST

Check the style names, they should be different for each menu and submenu. Check your file paths.

I need sleep now.
maz


Poster: bobwill
Dated: Sunday October 12 2003 - 17:00:05 BST

One of the things that I spotted is the lack of a ";" at the end of each line.

You have:
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work")

I beleive it should be:
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work;");

A ";" is used to end each option and also the end of the line of code.


Poster: John
Dated: Sunday October 12 2003 - 17:22:19 BST

I see at least 2 problems...

1. Your JS calls in the HTML are wrong. I don't remember exactly when the format changed, but you will need to read install.txt that is in the new download - it's there for a reason.

2. RC17 is the current release. You are running RC11. Upgrade.

Many of us are finding the calls work better as the first items after the <body> tag, although they should work in either place. This is not the cause of your error, however. I suspect you'll find that in #1.


Poster: simongdawson
Dated: Sunday October 12 2003 - 19:45:20 BST

I've done all the things above (latest RC17, added semicolons, new js calls in html) but still nothing. I don't know if it is relevant but the downloaded sample menu doesn't work either - see http://www.the-limes.com/milonic5_sample.html

Is it anything to do with my having the scripts in a separate directory?


Poster: John
Dated: Sunday October 12 2003 - 22:46:47 BST

simongdawson wrote:
Is it anything to do with my having the scripts in a separate directory?

No, just so the calls to the JS are correct.

However, your milonic_src.js still shows as RC11, while the other 2 code files show RC17. They must all be the same version.


Poster: simongdawson
Dated: Monday October 13 2003 - 7:04:40 BST

jgillett wrote:
However, your milonic_src.js still shows as RC11, while the other 2 code files show RC17. They must all be the same version.


They were all (inc. milonic_src.js) updated at the same time to RC17. It must have been some sort of cached version you saw, or a temporary internet file.


Poster: simongdawson
Dated: Monday October 13 2003 - 7:49:00 BST

I've been experimenting. I've just made a new directory at http://www.the-limes.com/milonic/ and then copied into it the v5 sample files and made a new html page in that diectory http://www.the-limes.com/milonic/sample.html onto which I pasted the js calls from readme.txt. The menu works perfectly. I then copied to http://www.the-limes.com/milonic/ my own two menu_data files and called them up from a new page within the directory http://www.the-limes.com/milonic/test.html. menu_data_1 works perfectly, menu_data_2 still has a problem, so I have temporarily put it between <!-- and --> . Please note that all of these .js files are just copies from the /Java/ directory on my website and not altered in any way.

There is definitely something wrong in the way that the menu script is handling the location of scripts when they are not in the same directory as the page calling for them.

RC8 had a line at the top of milonic_src.js reading //scriptpath=""; which could be altered e.g. scriptpath="/java/"; but this line does not exist in RC17 and when I added it, it made no difference.

Does this help you to help me, please?


Poster: fredlongworthhighschool
Dated: Monday October 13 2003 - 8:34:37 BST

"Scriptpath" was removed last month. There is more about it here http://www.milonic.com/forum/viewtopic.php?t=2529


Poster: bobwill
Dated: Monday October 13 2003 - 14:13:31 BST

In "menu data 2" you have the following code:

with(=new mm_style()){
offcolor="#228B22";
offbgcolor="#FFFFF0";
oncolor="#FF0000";
onbgcolor="#FFFFF0";
fontsize="14";
fontstyle="normal";
fontweight="bold";
fontfamily="Tahoma,Helvetica,Verdana";
padding=2;

You have a missing name on the the first line, plus I not sure that code is not suppose to be deleted since you follow it with the correct code in your file.

with(somename=new mm_style()){


Poster: John
Dated: Monday October 13 2003 - 17:11:11 BST

Nice catch, BW. I missed that one. Hopefully that's it.

Andy is correct on scriptpath. It's gone, so don't try to add it back in.

simongdawson wrote:
There is definitely something wrong in the way that the menu script is handling the location of scripts when they are not in the same directory as the page calling for them.

Actually that function works just fine. The problem is elsewhere.


Poster: simongdawson
Dated: Monday October 13 2003 - 17:48:52 BST

I cannot for the life of me explain this, but....

I got the sample and my two menu_data files working in the http://www.the-limes.com/milonic/ directory on the pages http://www.the-limes.com/milonic/sample.html and http://www.the-limes.com/milonic/test.html.

I then changed the links to on http://www.the-limes.com/milonic5_test.html to link to the /milonic/ files instead of the /java/ files and lo and behold the page and menu worked perfectly. So I copied the files again form /milonic/ to /java/ to make sure that they were the same. Changed the js calls on http://www.the-limes.com/milonic5_test.html back to the /java/ files and it was back to not working. They only seem to work in the other /milonic/ directory.........


Poster: Maz
Dated: Monday October 13 2003 - 17:49:36 BST

You still need your /milonic/ paths:

<SCRIPT language=JavaScript src="/milonic/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="/milonic/menu_data.js" type=text/javascript></SCRIPT>

Regards
maz


Poster: simongdawson
Dated: Monday October 13 2003 - 17:54:26 BST

maz wrote:
You still need your /milonic/ paths:

<SCRIPT language=JavaScript src="/milonic/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/milonic/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="/milonic/menu_data.js" type=text/javascript></SCRIPT>

Regards
maz


Yes, they work like that. But why, when I have exactly the same files in the /java/ directory does it not work if I change the js calls to the /java/ directory?


Poster: bobwill
Dated: Tuesday October 14 2003 - 13:44:55 BST

I just checked out the link http://www.the-limes.com/milonic5_test.html and this file still points to the "milonic" directory. Where is the test link that uses the "java" directory??


Poster: simongdawson
Dated: Tuesday October 14 2003 - 18:54:52 BST

bobwill wrote:
I just checked out the link http://www.the-limes.com/milonic5_test.html and this file still points to the "milonic" directory. Where is the test link that uses the "java" directory??


Sorry about that - I've been using the same test page and editing the js calls from one directory to another. Now I have set up two test pages, one for each directory. The /java/ test page is now at http://www.the-limes.com/milonic5_test2.html whereas the /milonic/ test page is at http://www.the-limes.com/milonic5_test.html


Poster: bzeitner
Dated: Tuesday October 14 2003 - 19:29:55 BST

The http://www.the-limes.com/milonic5_test2.html link had no issues using IE6. But I did notice a problem that you may want to clear up in menu_data_1.js and menu_data_2.js:

Code:
with(milonic=new menuname("SubMenu")){
itemwidth=110;
style=menuStyle;
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work");
aI("text=Genealogy;showmenu=GenealogyMenu;url=#;status=Mouse over for Genealogy menu");
aI("text=Contacts;showmenu=ContactMenu;url=#;status=Mouse over for Contacts menu");
aI("text=Links;showmenu=LinksMenu;url=#;status=Mouse over to see Links menu");
aI("text=Guest Book;url=http://www.the-limes.com/guestbook/index.php;;status=Click to go to our Guest Book");
aI("text=Search;url=http://www.the-limes.com/search/search.html;;status=Click to search within our web site");
}

with(milonic=new menuname("EmailMenu")){
itemwidth=60;
style=menuStyle;
aI("text=Thelma;url=tdawson __at__ the-limes.com;;status=Click to email Thelma");
aI("text=Simon;url=simon __at__ the-limes.com;;status=Click to email Simon");
}


Notice the double semicolon's before the status? and no semicolon before the end of the line's quotation mark? Good practice would be as follows:
Code:
aI("text=Simons Work;showmenu=WorkMenu;url=#;status=Mouse over to see menu for Simons work;");


Also, the following code, at the top of each file, only needs to be declared once for each page. Keep it in the first menu you call. Otherwise, you're just wasting space.

Code:
_menuCloseDelay=500;
_menuOpenDelay=150;
_scrollAmount=3;
_scrollDelay=20;
_followSpeed=5;
_followRate=40;
_subOffsetTop=4;
_subOffsetLeft=6;


Poster: John
Dated: Tuesday October 14 2003 - 19:37:57 BST

bzeitner wrote:
Notice the double semicolon's before the status? and no semicolon before the end of the line's quotation mark?

Technically they should be there, you are correct. However, I'm pretty sure Andy has allowed for those missing and for the doubles (put there by the converter).


Poster: bzeitner
Dated: Tuesday October 14 2003 - 19:58:16 BST

I think I found the source of your issue... in the /milonic/menu_data_2.js file, I found the following line:
Code:
aI("text=<script language='JavaScript'>dT();</script>;url=#;align=right;;status=#;");


I really don't think the menu is set up to handle something like that. Or could I be wrong? Even if it does work, I don't see this function declared in any of the included source files.


Poster: Hergio
Dated: Wednesday October 15 2003 - 2:18:27 BST

Yes you are allowed to incorporate SCRIPT includes into the text of a menu item. Whatever is inside those script tags is executed as if it was written out in the open in the page. You just have to nail the syntax and what your quotes and single quotes. ;)


Poster: simongdawson
Dated: Wednesday October 15 2003 - 7:34:49 BST

I have at last sorted things out so that everything (!) is working. See http://www.the-limes.com/milonic5_test.html . In the bottom left hand corner of the screen is a block of stuff all produced by my second menu_data file. It is produced by two php scripts, one javascript, and a linked image from Yahoo Messenger hyperlinked to email me directly.

I have done all the corrections regarding double and missing semicolons, and duplicated blocks, but as you surmised, this was not what was causing the problem.

I renamed menu_data_2.js to menu_data.php. It still works fine, but it allowed me to run php scripts from within it. That incidentally meant I could rename menu_data_1.js to menu_data.js.

I still have no idea why the menu refuses to work in the /java/ directory, but maybe it is because I still have v3 running from there and perhaps there is a conflict. I'll change all of the js calls on my website from the v3 menu to the v5 menu over the next few days and then clear v3 from the website.


Poster: John
Dated: Wednesday October 15 2003 - 15:03:55 BST

Working, apparently - all fixed, not yet (sorry).

The page throws a JS error as soon as it loads - '_tp' is not defined.

I like the borderless style, though. Looks good.


Poster: simongdawson
Dated: Wednesday October 15 2003 - 15:12:18 BST

jgillett wrote:
Working, apparently - all fixed, not yet (sorry).

The page throws a JS error as soon as it loads - '_tp' is not defined.

I like the borderless style, though. Looks good.


I think that I fixed that a while ago - I suspect you're still seeing a cached page. I'm not getting any errors showing up now at my end. Please let me know if the problem persists. I've changed all the js calls on my website pages to point at the new v5 menu so it is now visible on every page of my website (I hope).


Poster: John
Dated: Wednesday October 15 2003 - 16:15:55 BST

Cache is clear (in theory, anyway). That's done every morning, but IE doesn't always cooperate.

'_tp' is undefined error


Poster: simongdawson
Dated: Monday October 20 2003 - 17:52:13 BST

jgillett wrote:
Working, apparently - all fixed, not yet (sorry).

The page throws a JS error as soon as it loads - '_tp' is not defined.

I like the borderless style, though. Looks good.


Sometimes the error "'_tp' is undefined" is produced, sometimes it isn't. If it is produced, refreshing the page always clears it. Have you any idea how I can stop this error occuring, please?

Re: '_tp' is undefined error


Poster: John
Dated: Monday October 20 2003 - 23:06:11 BST

simongdawson wrote:
Sometimes the error "'_tp' is undefined" is produced, sometimes it isn't. If it is produced, refreshing the page always clears it. Have you any idea how I can stop this error occuring, please?

Not specifically, but here's something I don't like...
Code:
<script language="JavaScript" src="/java/milonic_src.js" type="text/javascript">
</script>
<script language="JavaScript" src="/java/clock.js"></script>...

You're calling clock.js in the middle of calling all of the menu items. Not sure, but I think that might make the menu unhappy.

Re: '_tp' is undefined error


Poster: simongdawson
Dated: Tuesday October 21 2003 - 6:12:32 BST

jgillett wrote:
You're calling clock.js in the middle of calling all of the menu items. Not sure, but I think that might make the menu unhappy.

That's not it. Until less than 24 hours ago every page on my website had the milonic js calls all listed consecutively. I changed two or three pages yesterday to place clock.js after milonic_src.js to see if it made any difference. It didn't, and I hadn't bothered to change them back again. I have now changed them back. Any other ideas?

Re: '_tp' is undefined error


Poster: John
Dated: Tuesday October 21 2003 - 15:14:47 BST

simongdawson wrote:
Any other ideas?

Yep. The problem is somewhere in the menu_data.php file. I pulled your code down here and still got the failure running against my menu code files. Removing that call stopped the error. Since I'm unable to see the php scripts included in that my guess is the problem is in there.

You might also want to get a doctype in place. Your page just starts with <head>.

Re: '_tp' is undefined error


Poster: simongdawson
Dated: Tuesday October 21 2003 - 20:09:29 BST

jgillett wrote:
The problem is somewhere in the menu_data.php file. I pulled your code down here and still got the failure running against my menu code files. Removing that call stopped the error. Since I'm unable to see the php scripts included in that my guess is the problem is in there.
You can download the php scripts from http://www.phponline.biz/usersonline/index.php.
jgillett wrote:
You might also want to get a doctype in place. Your page just starts with <head>.
I've now been through my website and checked that all pages now have a doctype.

Hope this helps.


Poster: Hergio
Dated: Tuesday October 21 2003 - 22:52:59 BST

You should also put a opening <HTML> tag in there. That may help something.

Remove each script one at a time. Take out the clock, see if the errors continues, if so, put clock back in and remove another. Narrow it down to ONE php script thats conflicting with the menu. There may be a variable duplication or conflict somewhere. Get it down to a script then we can go from there...because it definetly sounds like a script conflict from John's comments.


Poster: simongdawson
Dated: Thursday October 23 2003 - 7:45:27 BST

Hergio wrote:
You should also put a opening <HTML> tag in there. That may help something.

Remove each script one at a time. Take out the clock, see if the errors continues, if so, put clock back in and remove another. Narrow it down to ONE php script thats conflicting with the menu. There may be a variable duplication or conflict somewhere. Get it down to a script then we can go from there...because it definetly sounds like a script conflict from John's comments.


I've been through my website pages and made sure that they now all have an opening <HTML> tag. (It didn't do anything to help sort the problem, though).

Then I started removing lines from menu_data.php by enclosing them between <!-- and --> (firstly one at a time, and then in various combinations) but to my frustration the only way that I can stop the error occurring is to have all four of the lines removed so that there are no items on the menu. Then I appear not to get the problem. I have left menu_data.php in this state at present in case it helps. Of course, as a result, there is nothing displayed in the bottom left hand corner of my web pages at present (and no _tp error messages!).


Poster: simongdawson
Dated: Saturday October 25 2003 - 6:09:14 BST

I take it by the long pause that nobody is able to help me. Does this tutorial help? It is a rather beyond me....

http://www.javascriptkit.com/javatutors ... java.shtml


Poster: John
Dated: Saturday October 25 2003 - 16:29:20 BST

I'm not sure that align=centre; will work. Change that to align=center; (but that's not the cause of this problem).

Did you do as Dave suggested - remove the php scripts one at a time from menu_data.php until you find the specific script in there that is causing the problem?


Poster: simongdawson
Dated: Saturday October 25 2003 - 17:48:40 BST

jgillett wrote:
I'm not sure that align=centre; will work. Change that to align=center; (but that's not the cause of this problem).


OK. I've changed the offending UK spelling (which incidentally was not recognised by the script).

jgillett wrote:
Did you do as Dave suggested - remove the php scripts one at a time from menu_data.php until you find the specific script in there that is causing the problem?


Yes, I did. Please see my reply to him above. I have since removed the <!-- and --> from all the menu items, but as I said above, with menu_data.php displaying four 'active' items (one javascript, two php scripts and a hyperlinked Yahoo Messenger online/offline indicator) it was only by removing all four of the menu items that the _tp error disappeared. Otherwise its occurance is apparently irrational and unpredictable sometimes appearing on a given page and sometimes not, but always when it does occur it is 'cleared' by refreshing the page......

Any ideas?


Poster: John
Dated: Saturday October 25 2003 - 22:37:25 BST

simongdawson wrote:
jgillett wrote:
Did you do as Dave suggested - remove the php scripts one at a time from menu_data.php until you find the specific script in there that is causing the problem?


Yes, I did. Please see my reply to him above. I have since removed the <!-- and --> from all the menu items...

I have noticed in ColdFusion that sometimes just putting comment around code does not take it out of the picture - it gets run anyway. I have to remove it entirely from the page. Maybe that's happening here as well.

Note in my reply somewhere above that I was able to run clean by removing just the menu_data.php call. Since we can't see that, please post the entire menu_data.php here. Be sure to enclose it in code tags.


Poster: simongdawson
Dated: Sunday October 26 2003 - 7:48:27 GMT

My menu_data.php file reads as follows:

Code:
with(menuStyle2=new mm_style()){
offcolor="#000000";
offbgcolor="#FFFFF0";
oncolor="#000000";
onbgcolor="#FFFFF0";
fontsize="10pt";
fontstyle="normal";
fontweight="normal";
fontfamily="Tahoma, Helvetica, Verdana";
padding=2;
}

with(milonic=new menuname("MainMenu")){
left=10;
itemwidth=150;
screenposition="bottom";
style=menuStyle2;
alwaysvisible=1;
alignment="center";
followscroll=1;

aI("text=<script language='JavaScript'>dT();</script>;url=#;align=left;status=The current time and date in Chalfont St. Peter;");
aI("text=<img border=0 src=http://opi.yahoo.com/online?u=simongoodhughdawson&m=g&t=2>;url=simon __at__ the-limes.com;align=left;status=Click to email Simon;");
aI("text=<? include($DOCUMENT_ROOT."/online/online.php");?><br>;align=left;status=The number of visitors to the-limes.com currently online;");
aI("text=<? include($DOCUMENT_ROOT."/online/today.php");?><br>;align=left;status=The number of visitors to the-limes.com today;");
}

drawMenus();


I have been playing around as per your suggestion totally removing the various calls in menu_data.php, both singly and in various combinations. As far as I am able to ascertain, the following two calls do not produce the error, either singly or in combination:

Code:
aI("text=<img border=0 src=http://opi.yahoo.com/online?u=simongoodhughdawson&m=g&t=2>;url=simon __at__ the-limes.com;align=left;status=Click to email Simon;");
aI("text=<? include($DOCUMENT_ROOT."/online/online.php");?><br>;align=left;status=The number of visitors to the-limes.com currently online;");


The other two calls each produce the error.

The clock script reads as follows:

Code:
// Clock Script By Maxx Blade
// http://www.maxxblade.co.uk

// Use the following within your HTML to Start/display your clock
// <script language="JavaScript">dT();</script>

function lZ(x){ return (x>9)?x:'0'+x; }
function tN(){ return new Date(); }
function wT(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()+daysave()+tZo); return x; }
function lmT(){ return new Date(document.lastModified); }
function fY(x){ return (x<500) ? x+1900 : x; }
//function hr12(x){ ap=(x>11)?' PM':' AM'; if(x==0){ x=12 } return (x>12)?x-=12:x; }
//function eD(x){ if(x==1||x==21||x==31){ return 'ST'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; }
function dT(){
   if(fr==0){ fr=1; document.write('<font size="3"></font>UK Time<br><span id="ts" >'+eval(cTt)+'</span></font><br>'); document.write('<font size="3"></font>'+eval(tTt)+'</font>'); }
   if(!ns4){ with(eval(tsd)){ innerHTML=eval(cTt); } }
   clockTO=setTimeout('dT()',1000);
}
function fDay(d,m,h,p){
   var week=(p<0)?7*p:-7*(p-1),nm=(p<0)?m+1:m,tD=new Date(tN().getUTCFullYear(),nm,1,h,0,0);
   if(p<0){ tD.setTime(tD.getTime()-da1); }
   if(tD.getDay()!=d){ dOff=(tD.getDay()<d)?(d-tD.getDay()):(tD.getDay()-d); tD.setTime(tD.getTime()+((dOff+week)*da1)); }
   return tD;
}
function daysave(){ return ( ( tN().getTime()>fDay(0,2,1,-1).getTime() ) && ( tN().getTime()<fDay(0,9,1,-1).getTime() ) ) ? 3600000 : 0; }
var ns4=(document.layers)?1:0,ie4=(document.all)?1:0,ns6=(document.getElementById&&!document.all)?1:0,tsd=(ns6)?"document.getElementById('ts')":"document.all['ts']",thetitle=document.title,da1=86400000,tZo=0,fr=0,ap,dN=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),mN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),tTt="dN[wT().getDay()]+' '+wT().getDate()+'<br>'+mN[wT().getMonth()]+' '+fY(wT().getYear())",cTt="lZ(wT().getHours())+':'+lZ(wT().getMinutes())+':'+lZ(wT().getSeconds())",dLm="dN[lmT().getDay()].substring(0,3)+' '+lmT().getDate()+(lmT().getDate())+' '+mN[lmT().getMonth()].substring(0,3)+' '+fY(lmT().getYear())+' __at__ '+lZ(lmT().getHours())+':'+lZ(lmT().getMinutes())";


The 'Users Today' script can be downloaded free from http://www.phponline.biz/usersonline/index.php (I have not reproduced its content here because although it is a free script, it states in its headers that 'This software/script should not be copied, modified or distributed in any form.').


Poster: simongdawson
Dated: Sunday October 26 2003 - 16:39:20 GMT

I've just been checking the site on my laptop (as opposed to my PC which I was using when I last posted). The other two calls are producing the error as well now. Both my laptop and PC are set to delete all Temporary Internet Files when IE6 is closed and I have been closing it (and FrontPage) each and every time I try deleting and then checking a call.

I don't know if it makes any difference, but when I have been clicking around to see if the error occurs it is usually (but not always) on php dynamically produced pages (because most of the pages on my website are produced this way).


Poster: Hergio
Dated: Monday October 27 2003 - 18:36:08 GMT

BTW, you have two menus with the same name. You have a menu defined in your menu_data.js called MainMenu and a menu defined in your menu_data.php called MainMenu. Definetly change that up.


Poster: simongdawson
Dated: Tuesday October 28 2003 - 6:22:56 GMT

Hergio wrote:
BTW, you have two menus with the same name. You have a menu defined in your menu_data.js called MainMenu and a menu defined in your menu_data.php called MainMenu. Definetly change that up.


Right. I've just changed that. MainMenu in menu_data.js is now TopMenu and MainMenu in menu_data.php is now BottomMenu.

I still have the _tp error......


Poster: simongdawson
Dated: Thursday October 30 2003 - 21:24:55 GMT

It may be (!) that I have sorted out the infernal _tp error......

bzeitner wrote:
Also, the following code, at the top of each file, only needs to be declared once for each page. Keep it in the first menu you call. Otherwise, you're just wasting space.

Code:
_menuCloseDelay=500;
_menuOpenDelay=150;
_scrollAmount=3;
_scrollDelay=20;
_followSpeed=5;
_followRate=40;
_subOffsetTop=4;
_subOffsetLeft=6;


I had done as bzeitner recommended and had the _tp error. I have today deleted the above block of code from menu_data.js and inserted it instead in the second menu I call, i.e. menu_data.php. I would appreciate it if anyone tells me if I am still producing the _tp error on any page at http://www.the-limes.com .


Poster: John
Dated: Thursday October 30 2003 - 22:02:07 GMT

The error is still there. Sorry...


Poster: Hergio
Dated: Sunday November 2 2003 - 19:33:38 GMT

I just noticed you do not define top anywhere in your code. I was going through the menudom code and saw some correlation between top and _tp, and although I really am not sure exactly what their relationship is, I think they have something to do with eachother. In your topMenu, set your top=0; and in your bottom menu set your top to top="offset=0";

Let me know if that helps.


Poster: simongdawson
Dated: Monday November 3 2003 - 7:32:13 GMT

Hergio wrote:
I just noticed you do not define top anywhere in your code. I was going through the menudom code and saw some correlation between top and _tp, and although I really am not sure exactly what their relationship is, I think they have something to do with eachother. In your topMenu, set your top=0; and in your bottom menu set your top to top="offset=0";

Let me know if that helps.


Right, I've done that - e.g. from menu_data.js :
Code:
with(milonic=new menuname("TopMenu")){
top=0;
left=10;

But I am still getting a totally unpredictable and erratic error, only this time it reads:

Line: 17
Char: 324
Error: Invalid argument
Code: 0

This error message is stopped by removing the line top="offset=0"; from menu_data.php. If I change the top="offset=0"; line to two lines top=0; offset=0; then I get back to the old unpredictable and erratic _tp error.......


Poster: Hergio
Dated: Monday November 3 2003 - 16:29:46 GMT

Ok, lets do some more troubleshooting if you dont mind here. Try each one, see if it works, then move on to the next...

Firstly, remove the offset=0 line, there is no offset property. It must be passed in as part of the top or left property.

Secondly, remove the alignment="right" and alignment="center"...there is no property by that name. There is however an "align" property that can be declared in either a style, menu, or menu item.

Comment out your screenposition properties in both menus. Make sure to give both menus definite top and left coordinates. Say your top menu should have top=10; and left = 5; and your bottom menu should have top=300; and left = 5;. See if this remedies the error. Its gotta have something to do with your positioning I think...the _tp is making me think that way.

Try commenting things out after that and try different combinations of things to see if you do one thing and it fixes it, note what happens and let us know.

We'll figure this out soon enough!


Poster: simongdawson
Dated: Tuesday November 4 2003 - 6:45:07 GMT

I worked my way through your list of suggestions, Dave, until I got to changing top=0; to top=300; in menu_data.php (without having got so far as to comment out the screenposition properties). I think (!) that the error may have gone away, but due to its erratic and unpredictable nature it may still be there. Please would anyone let me know if they still see it on my website at http://www.the-limes.com ? If the error has gone, then it would appear that with a screenposition="bottom"; property it is necessary to have a top=#; property with a value greater than 0.

While we are sorting these things out, can you please tell me how to nudge up a few pixels from the bottom of the screen the display produced by menu_data.php?


Poster: John
Dated: Tuesday November 4 2003 - 13:58:07 GMT

Much as it pains me to say this - :roll: - I don't get the error now. Of course, as you say, it could still be lurking somewhere...


Poster: Hergio
Dated: Tuesday November 4 2003 - 21:56:40 GMT

Pains you? I am excited! :D Ok we are getting somewhere! Now it kinda makes sense though, if in a menu you do not declare a position, what does it default to? absolute, right? So for anything to be absolute it needs coordinates and he wasn't giving them to the menu. Even if you have screenposition set, it needs something apparently. Even if the menu is top and left, you should at least put in 0,0, ya know? And if its on the bottom, set it to something, and the screenposition should take over from there. I think its not lurking anymore, I think it was the top/left properties needing to be set.

Regarding moving the menu up, try for your bottom menu top="offset=20"; or top="offset=-20";
I am unsure which direction it will go and also if the -20 will work because someone recently mentioned they can't get negative offsets to work. But thats how you would tweak the screenpositioning...as seen with example 23 on the milonic website, "using screenposition and offsets".... Best of luck!


Poster: John
Dated: Tuesday November 4 2003 - 22:19:07 GMT

Hergio wrote:
Pains you? I am excited!

Of course! It means we are coming to the end of this marathon :!: :D


Poster: simongdawson
Dated: Wednesday November 5 2003 - 7:07:13 GMT

Yes, I think my friends, that we can say that this one is now sorted. Many thanks to everyone who helped or tried to help!


Poster: simongdawson
Dated: Wednesday November 5 2003 - 7:28:40 GMT

Hergio wrote:
Regarding moving the menu up, try for your bottom menu top="offset=20"; or top="offset=-20";
I am unsure which direction it will go and also if the -20 will work because someone recently mentioned they can't get negative offsets to work. But thats how you would tweak the screenpositioning...as seen with example 23 on the milonic website, "using screenposition and offsets".... Best of luck!

It's no good using the top="offset=20"; or top="offset=-20"; method because the 'screenposition' property overrides the 'top' property, and besides which it gives the error:

Line: 17
Char: 324
Error: Invalid argument
Code: 0

On the example 23 menu generator on the website, as the other user noted, negative offsets don't work because numeric integer values are only permitted and as a consequence the minus sign is not recognised.


Poster: Hergio
Dated: Wednesday November 5 2003 - 20:47:49 GMT

Actually after looking at Andy's code for sample 23, he is accepting negative integers, just doing nothing if they are found. He just takes the value straight from the offset box and puts it in a conditional statement as in if( toffset >= 0 ) { ...change the offset } and same for left. Yes, this IS an implicit cast to an integer, so abc would not work since abc >= 0 would not resolve to true. But -45 would be accepted but fails the conditional and so nothing is done.

On the other note, offsets are only supposed to be used with screenposition is what I gather from what Andy has said in the past. See...
http://www.milonic.com/forum/viewtopic. ... ion+offset
http://www.milonic.com/forum/viewtopic. ... ion+offset
http://www.milonic.com/forum/viewtopic. ... ion+offset

Not sure what the problem is.... hmmm :roll:


Poster: simongdawson
Dated: Thursday November 6 2003 - 8:00:27 GMT

I have played around with the 'top' property until I am blue in the face, but I still cannot prevent the erratic and unpredictable error

Line: 17
Char: 324
Error: Invalid argument
Code: 0

from appearing from time to time. I have currently left the menu_data.php file on my website including the following code
Code:
with(milonic=new menuname("BottomMenu")){
top="offset=-7";
left=10;
itemwidth=150;
style=menuStyle2;
screenposition="bottom";
alwaysvisible=1;
followscroll=1;

so the error will be showing from time to time on the pages of my website at http://www.the-limes.com.

Anyone got any ideas?