Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 1,704
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
http://www.iphq.net/tpmbot/?tab=3

The main menu at the top of the page works fine, but on the Commands tab, clicking one of the command names to bring up more information about it (in the space below the command list) brings up a JS error. The weird thing is, though, that the page actually loads, displays and works fine.

I asked Al, but he wasn't certain what was wrong. Could someone else take a look please? confused

Sponsored Links
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Error: document.getElementById(commands[i]) has no properties
Source File: http://www.iphq.net/tpmbot/nav.js
Line: 18

Has no properties -> undefined.

When defining it inside the HTML file, don't use var to declare it. var is sorta like Perl's my - it scopes to the local block. By dropping off the var, you create it globally, which should work better...


UBB.classic: Love it or hate it, it was mine.
Joined: Nov 2001
Posts: 1,704
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Thanks Charles. smile

Got rid of the vars from all of the variables I set in the HTML header (I was accessing the other variables through nav.js too, so it's for the best). But unfortunately the JS error is still appearing. frown

I thought it might have something to do with the use of the return false; function (or maybe just return) twice in the same script, but I'm probably wrong...

Joined: Nov 2001
Posts: 1,704
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Uhh... Okay, I understand the problem now. I hadn't defined everything in the commands variable. God, it all makes sense when you enable higher-level script debugging... tipsy

Thanks again, Charles, you put me on the right line to my mistake. The variable was the problem, not the code. smile

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Aha, looks pretty good now... though you'll want to examine it in 800x600 or so. The tabs at the top are wrapping...

You also might want to look at adding

cursor: pointer;
cursor: hand;

to the CSS rule for the descrptive not-quite-links so that they "feel" clickable.


UBB.classic: Love it or hate it, it was mine.
Sponsored Links
Joined: Nov 2001
Posts: 1,704
CTM
Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
Ah, you're right, it does look disguesting at 800x600. I made the font size on the tabs 10pt now, it looks much better at 1024x768 too. smile

And I thought you could only change cursors using JavaScript in IE... Meh, just goes to show how stupid I am, I guess. wink

Oh, and that reminds me, I thought I'd credited solareclipse in the HTML comment, but I hadn't... It's in there now. wink

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Thanks. wink


UBB.classic: Love it or hate it, it was mine.

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)