Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: JavaScript Error: TREE_ITEMS is Undefined
BaptistKitty
Junior Member

Posts: 3
Registered: 2/7/2005
Member Is Offline
posted on 2/7/2005 at 02:50 PM Reply With Quote
JavaScript Error: TREE_ITEMS is Undefined


I keep getting the error 'JavaScript Error: MENU_ITEMS is Undefined' and I don't understand why. It seems to happen whenever I edit the tree_items.js file but only some times. I figure I must have edited it wrong but I don't know how I could of. What causes that?

Thanks for any help...
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 5/27/2005 at 04:26 AM Reply With Quote

Usually this is caused by syntax error in the structure.
View User's Profile View All Posts By User U2U Member
slug
Junior Member

Posts: 2
Registered: 9/15/2005
Location: Rochester
Member Is Offline
posted on 9/15/2005 at 09:04 PM Reply With Quote

post the menu if you haven't fixed it by now and have someone looad at it.
View User's Profile View All Posts By User U2U Member
matejfn
Junior Member

Posts: 4
Registered: 8/31/2006
Location: Slovenija
Member Is Offline
posted on 8/31/2006 at 07:34 AM Reply With Quote

I have the same problem.

BUT it is only IE issue. In Opera and FireFox everything is fine.

I generate TREE_ITEMS with PHP.

<script language='JavaScript' type='text/javascript'><?php echo $ITEMS ?></script>

I get page source in browser: (it works in FF & Opera)

<script language='JavaScript' type='text/javascript'> var TREE_ITEMS = [["test", null]];</script>

If I copy this string from browser page source and post it in my script like:

<script language='JavaScript' type='text/javascript'> var TREE_ITEMS = [["test", null]];</script>

IE works fine.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 8/31/2006 at 09:28 AM Reply With Quote

Looks identical to me so there should be no problem. If there is a problem then look for differences. The browser has no way of knowing if that text was there statically or it's generated.
View User's Profile View All Posts By User U2U Member
matejfn
Junior Member

Posts: 4
Registered: 8/31/2006
Location: Slovenija
Member Is Offline
posted on 8/31/2006 at 10:42 AM Reply With Quote

I looked for differences in string, but there are no differences. The strings are 100% identical.

I know that browser has no way of knowing that. But is it posible that IE runs function before var TREE_ITEMS is set correctly?

my total code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<script language='JavaScript' type='text/javascript' src="{$prj->dir_js}tree.js"></script>
<script language='JavaScript' type='text/javascript' src="{$prj->dir_js}tree_tpl.js"></script>
<script language='JavaScript' type='text/javascript'>var TREE_ITEMS = [{$tree}];</script>
</head>
<body>
<script language="JavaScript">
<!-- //
new tree (TREE_ITEMS, TREE_TPL);
// -->
</script>
</body>
</html>
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 8/31/2006 at 10:47 AM Reply With Quote

If there is the problem with the IE running the code incorrectly it would appear in both cases. something must be different.
View User's Profile View All Posts By User U2U Member
matejfn
Junior Member

Posts: 4
Registered: 8/31/2006
Location: Slovenija
Member Is Offline
posted on 9/4/2006 at 06:23 AM Reply With Quote

It was character encoding in borwser.

Data from DB are windows-1250 page was UTF-8 if i copyied string into page it vas OK becous it get same encodin as page.

Now it's working :)

TNX
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004