JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
Denis
Joined: 28 Feb 2005 Posts: 5 Location: Russia
|
Posted: Wed Mar 09, 2005 5:47 pm Post subject: JS Error: Object doesn't support this property method |
|
|
This error happens when page completely loaded.
I have check it in Visual InterDev.
The problem happen there:
if(typeof(window._1$)=='function')window._1$()
I don't use any onload/onunload scripts.
Browser IE 6.0
OS. WinXP SP2
JavaScript Debuger - VisualInterDev 6.0
Thanks.
Denis |
|
| Back to top |
|
 |
Denis
Joined: 28 Feb 2005 Posts: 5 Location: Russia
|
Posted: Wed Mar 09, 2005 6:05 pm Post subject: Additional notes: |
|
|
When I add dummy onload and onunload script functions.. error not happen more..
Any suggestions
Denis |
|
| Back to top |
|
 |
Victor_Chuiko Support Team
Joined: 12 Apr 2005 Posts: 145
|
|
| Back to top |
|
 |
gene.schneider
Joined: 30 Mar 2006 Posts: 2 Location: Perth, Western Australia
|
Posted: Thu Mar 30, 2006 9:19 am Post subject: Which versions? |
|
|
Hi,
Some of our clients and one developer's machine here also reports the "Object doesn't support this property or method" error which seems to have something to do with the code in the cooltreepro.js file shown below:
| Code: | window._oldCTOnLoad = window.onload;
window._oldCTOnUnLoad = window.onunload;
window.onload = function () {
var bw = new _BrowserDetector();
if (typeof(window._oldCTOnLoad) == 'function')
window._oldCTOnLoad();
}
window.onunload = function () {
for (var i in window.CTrees)
with (window.CTrees[i])
if (_format.cook)
_saveState();
if (typeof(window._oldCTOnUnLoad) == 'function')
window._oldCTOnUnLoad();
} |
The Developer's machine having the problem seems to be activating the 'function' logic, while everyone else is not.
We were using version 2.7.0 of COOLjsTree, but I've just tried 2.7.5, and the problem still occurs.
Any ideas/suggestions?
Here's the code from our menu page if this helps:
| Code: | <html>
<head>
<link rel="stylesheet" href="/dev1001_template/theme/talent2b/menu.css" type="text/css">
<script type="text/javascript" src="/dev1001_template/cooltree/scripts/cooltreepro.js"></script>
<script type="text/javascript">
// Tree format definition
var TREE_FORMAT = [
// 0. left position
0,
// 1. top position
0,
// 2. show buttons ("+" and "-" images)
true,
// 3. button images: collapsed state, expanded state, blank image
["", "", "/hrsprd_template/cooltree/images/blank.gif"],
// 4. size of buttons: width, height, indent amount for childless nodes
[14, 14, 0],
// 5. show icons ("folder" and "document")
false,
// 6. icon images: closed folder, opened folder, document
["/hrsprd_template/cooltree/images/e_folder_closed.gif",
"/hrsprd_template/cooltree/images/e_folder_opened.gif",
"/hrsprd_template/cooltree/images/document.gif"],
// 7. size of icons: width, height
[8, 2],
// 8. indent amount for each level of the tree
[0, 16, 32, 48, 64, 80, 96, 112, 128],
// 9. background color for the tree
"",
// 10. default CSS class for nodes
"menuNode",
// 11. individual CSS classes for levels of the tree
["menuNode","menuNode"],
// 12. "single branch" mode
false,
// 13. padding and spacing values for all nodes
[0, 1],
// 14. "explorer-like" mode
true,
// 15. images for "explorer-like" mode
["/hrsprd_template/cooltree/images/e_folder_closed.gif",
"/hrsprd_template/cooltree/images/e_folder_opened.gif",
"/hrsprd_template/cooltree/images/e_document.gif",
"/hrsprd_template/cooltree/images/m_mid_expand.gif",
"/hrsprd_template/cooltree/images/m_bot_expand.gif",
"/hrsprd_template/cooltree/images/m_mid_collap.gif",
"/hrsprd_template/cooltree/images/m_bot_collap.gif",
"/hrsprd_template/cooltree/images/m_vert_line.gif",
"/hrsprd_template/cooltree/images/m_mid_join.gif",
"/hrsprd_template/cooltree/images/m_bot_join.gif"],
// 16. size of images for "explorer-like" mode: width, height
[19, 16],
// 17. store tree state into cookies
true,
// 18. relative positioning mode
true,
// 19. initial space for the relatively positioned tree: width, height
[70, 200],
// 20. resize container of the relatively positioned tree
true,
// 21. change background-color and style for selected node
true,
// 22. background color for unselected node, background color for selected node, class for selected node
["", "", "menuNode"],
// 23. text wrapping margin
0,
// 24. vertical alignment for buttons and icons
"middle"
];
</script>
<script type="text/javascript">
// Tree structure definition
var TREE_NODES = [
[{id:1},"Personal Details", null, null,
[{id:2},"Personal Contacts", "WK8022$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:3},"Emergency Contacts", "WK8025$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"]
],
[{id:8},"Payroll Details", null, null,
[{id:9},"Current Payslip", "WK8020NZ$.startup?Z_EMPLOYEE_NUMBER=13330&P_MODE=FV", "Main"],
[{id:10},"Payslip History", "WK8020NZ$.startup?Z_EMPLOYEE_NUMBER=13330&P_MODE=RL", "Main"],
[{id:11},"Payslip Destination", "WK8026$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:12},"Bank Accounts", "WK8101$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"]
],
[{id:20},"Select Job", "WK515$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:21},"Leave", null, null,
[{id:22},"Leave Summary", "WK415$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"],
[{id:24},"Leave History", "WK410$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"]
],
[{id:39},"Skills & Development", null, null,
[{id:43},"Qualifications", "WK8264$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:47},"Training History", "WK8104$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"],
[{id:48},"Learning Outcomes", "WK8236$.Startup?Z_PROGRAM_ID=ILOCOMP", "Main"],
[{id:49},"Module Competency", "WK8236$.Startup?Z_PROGRAM_ID=IMODCOM", "Main"]
],
[{id:50},"Team Management", null, null,
[{id:51},"Performance Management", null, null,
[{id:52},"Team Review Calendar", "WK8070$.Startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:53},"Training & Development", "WK8072$.Startup", "Main"]
],
[{id:54},"Team Members", "wk8059$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:55},"Team Leave Calendar", "WK8106$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"],
[{id:56},"Team Leave Balances", "WK8111$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"],
[{id:57},"Team Leave Bookings", "WK8112$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"],
[{id:61},"Team Birthdays", "WK8113$.startup?Z_EMPLOYEE_NUMBER=13330&Z_JOB_NUMBER=01", "Main"],
[{id:62},"Manager Email Prompts", "WK8233$.Startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:65},"Learning Outcomes", "WK8236$.Startup?Z_PROGRAM_ID=LOCOMP", "Main"],
[{id:66},"Module Competency", "WK8236$.Startup?Z_PROGRAM_ID=MODCOM", "Main"]
],
[{id:89},"Pending Transactions", "wk8023$.startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:90},"Organisation Chart", "WK8135$.Startup?Z_EMPLOYEE_NUMBER=13330", "Main"],
[{id:92},"Change Password", "wk8048$.startup", "Main"],
[{id:93},"Help", "<http://intranet/hr/shared%20documents/sealord%20hr%20kiosk%20user%20guide.pdf>", "Main"]
];
</script>
</head>
<body>
<span class="menuNode"><center><a class="menuNode" href="javascript:void(menuTree.expandAll(),menuTree.draw())">Expand All</a> | <a class="menuNode" href="javascript:void(menuTree.collapseAll(),menuTree.draw())">Collapse All</a></center></span>
<P>
<script>
var menuTree = new COOLjsTreePRO("menuTree", TREE_NODES, TREE_FORMAT);
menuTree.init();
</script>
<script type="text/javascript">RedrawAllTrees()</script>
</body>
</html> |
Gene |
|
| Back to top |
|
 |
gene.schneider
Joined: 30 Mar 2006 Posts: 2 Location: Perth, Western Australia
|
Posted: Mon Apr 03, 2006 3:55 am Post subject: Yes, still having the error |
|
|
I mentioned in my original post that I have tried upgrading to 2.7.5, and the error IS STILL occurring.
I've just tried emailing information to both your javascript@cooldev.com and jssupport@cooldev.com, both reporting that your domain quota is full.
Looking at the cooltreepro.js script contained in both 2.7.0 and 2.7.5, the same logic exists, so I'm not sure how it would stop the error occurring. And I don't know the purpose of this code in your Tree?
If I remove the if .... == 'function' code from the onload and onunload functions the user's browser doesn't report any error and the menu works correctly. However, I don't know if there are any side effects of removing it, and obviously that would affect support/upgrades in the future anyway.
The problem seems to happen in IE, but not Firefox on her machine, but not at all on my machine, even though our IE versions appear to be identical.
Gene |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Sat Apr 29, 2006 12:46 am Post subject: |
|
|
During initialization tree grabs onload and onunload methods. First one is needed to draw the tree at the very first time (for those who forgot to add RedrawAllTrees call). Second one is needed to free some memory (yes, there is a garbage collection, but in IE it is broken or maybe not as good as it should be). These "if" statements call previous handlers, if any.
Sorry, but we can't fix this until we're able to reproduce the issue. If it works for everyone except one machine, then probably that machine must be fixed. |
|
| Back to top |
|
 |
|
|