Important: when posting, please provide your Club Number at a minimum, and as many details as possible.
For further info, please read This page before posting.

FTH4 BETA participation request are now CLOSED

The FTH4 Beta requests are now CLOSED. We have 106 clubs who requested to be part of the Beta. The clubs selected will be notified once their clubs are being moved to FTH4.

Another Javascript Mishap

  • DavidBrown
  • DavidBrown's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thanks: 0

Another Javascript Mishap

12 years 5 months ago
#33143
Club #4545
heightstoastmasters.com

I had a similar mishap on Friday. I tried to add the following snippet of Javascript:

<script type="text/javascript>
var q=document.getElementById("accordion2").getElementsByTagName("span");
var loggedIn=false;
for (var i = 0; i<q.length;i++){
if (q.classname="unlocked") loggedIn=true;
}
if (loggedIn) alert("Hi Dave");
</script>

Trying to get something different to happen if the user is logged on. (I now see I left out the closing quotes in the "type" tag, and I wouldn't be surprised of the "loggedIn" variable collided with something. Also, no <span> EVER has a class name "unlocked".)

Anyway, the main page loads, but the login links don't work. I can log in as administrator from other pages on the site, but the admin console won't launch, so I can't remove the snippet. Once again, I ask that you remove the offending Javascript snippet from the editable "home page" box.

With apologies,
David Brown
Heights Toastmasters, Club #4545
The topic has been locked.
  • Brian
  • Brian's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 12212
  • Thanks: 3901

Re: Another Javascript Mishap

12 years 5 months ago
#33144
David:

I suggest you test your java scripts before posting them on your site.

I have removed the offending code.
Thank you,

Brian McDonald DTM
Silver and Wiser Online Toastmasters Club #777940

Technical Support Consultant for FreeToastHost
The topic has been locked.
  • DavidBrown
  • DavidBrown's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thanks: 0

Re: Another Javascript Mishap

12 years 5 months ago
#33145
Good idea. Thanks again.

David Brown
Heights Toastmasters, Club #4545
The topic has been locked.
  • SteveTheTechie
  • SteveTheTechie's Avatar
  • Offline
  • Emeritus
  • Emeritus
  • Posts: 11492
  • Thanks: 3057

Re: Another Javascript Mishap

12 years 5 months ago - 12 years 5 months ago
#33146
Dave,

What you are doing will likely get broken in a few months anyway. I intend to change some of the references you making use of. (e.g., accordion2)
Last edit: 12 years 5 months ago by SteveTheTechie.
The following user(s) said Thank You: DavidBrown
The topic has been locked.
Moderators: BrianHeniPamrhtaylor3NotLiableNSBjgavinLcala305peterb323DebbieT
Time to create page: 0.147 seconds