4 Replies Latest reply on Oct 10, 2006 10:38 AM by Peter Grainge

    Javascript mysteriously stopped working

    robowoman Level 1
      I have been using the twisty (from Peter Grainge's site) in my Help topics as part of a Related Topics link. I use the twisty next to the words 'Related Topics', and then create a drop down hot spot of both the image and text. When the user clicks the image or the text, the list of related topics expands and the arrow changes to point down. I have created 17 projects with this in and all is fine. I have a template with this in and always add the down.gif and twisty.js to the baggage files (although the twisty.js does have to be added by editing the rhbag.apj file). I have gone to create another project and the javascript just won't work. I have tried creating a topic with the template and also by manually typing in the extra lines of code needed. The necessary files are in the baggage files but it just won't work. There is no error when you click on 'Related Topics' - you just see the links but no change in the arrow. I have tried importing a topic from a project that does work but this stops working. I have tried renaming a working project to trick it into being another project but this doesn't work either. I am really stuck. Hoping someone can shed some light. Thanks
        • 1. Re: Javascript mysteriously stopped working
          Peter Grainge Adobe Community Professional (Moderator)
          Could it be as simple as a relative path issue?

          Create another project and try there. Let us know if it works there.

          • 2. Re: Javascript mysteriously stopped working
            robowoman Level 1
            Peter

            Thanks for your reply. It is true that the project it stopped working in is in when I put some topics in a folder and tried to edit the path (pressumably incorrectly). However, before realising this I tried to copy a working project and the twisty also stopped working in this copy. I am baffled why it should stop working when I hadn't made any changes. I went to your site and downloaded a new copy of the javascript with the images and created a new project. All worked fine. However, if I try to edit the javascript with the names of my images it stops working (maybe I am breaking the javascript without realising). I think I will just rename my images to match your javascript and go with the working project. So, in short I still can't figure why my copy of the javascript stopped working in all cases after the relative path issue as the code still looks the same. However, work pressure means I will have to resist trying to solve the mystery and go with what currently works.
            Thanks for your Help and also for your useful Web site.
            • 3. Re: Javascript mysteriously stopped working
              MergeThis Level 4
              Line breaks (carriage returns) can disable JavaScript.

              There may be a more elegant way of testing this possibility, but here's what I do: Copy the JavaScript code into Word and turn on the Show/Hide button to reveal hidden paragraph marks. Remove any line breaks revealed by this process in the TrueCode (do not edit in Word and copy back into RH!).


              Good luck,
              Leon
              • 4. Re: Javascript mysteriously stopped working
                Peter Grainge Adobe Community Professional (Moderator)
                Maybe you used a filename with a space and no quotes? Maybe you didn't edit the script in the topic to be an exact match? Maybe you missed a reference in the javascript? Or something as Leon has suggested.

                You should be able to change the image name but if it ain't broke...