Inline Javascript Not Showing After First Debugging Run: requires FF restart

35 views
Skip to first unread message

Steve Penner

unread,
Aug 2, 2014, 3:06:17 PM8/2/14
to fir...@googlegroups.com
I have a case where the entire markup + embedded script is appearing when I first load a document.

Then I run it and it disappears.

The only way to make it appear is to exit FF and re-open it again.

But then it repeats the problem:  start FF -> load -> run -> no script -> exit FF -> loop back

Sebastian Zartner

unread,
Aug 2, 2014, 5:37:15 PM8/2/14
to fir...@googlegroups.com
From where does the script disappear? Could it be that you have a document.write() somewhere in your code? Do you have a URL, so the problem can be reproduced by us?

Sebastian

Steve Penner

unread,
Aug 2, 2014, 6:37:57 PM8/2/14
to fir...@googlegroups.com

There are no document.write() calls.  In working with XHTML documents in the past, I have learned insert element nodes with DOM method calls with script elements if somehow I need to dynamically play with doc structure.

Try this URL:  http://smhscience.scienceinteractive.org/tutoring/

I did another check of the markup (HTML 5 by the way) on W3 validator and it passes, so that is not a confounding problem.  I also noticed the page was saved as Western European encoding while there was a UTF-8 meta element in it, and so I saved it as UTF-8 without BOM and checked it, and it still does same thing.  I am working with FF 31.0 and FB 2.0.2

First let me describe the page in which there is a form that handles the javascript:

There is form that will help estimate the cost of tutoring when it is eventually debugged.  The form has several controls for selecting tutoring details that help to estimate the final cost.

As part of the debugging for the form in all cases, a function called randomChoices() is activated by a button control that says "Random Choices" and it sets up a random number to populate/set the controls, and give a result presented to the buyer of tutoring services.  Additionally a button control called "Break It Down For Me" appears, which when pushed calls a "breakDown" function, which then causes a table to appear with a breakdown of the computations (this is still in the process of being debugged).  This table is for debugging purposes particularly but will like be included for the final presentation..  [Note that the final styling/appearance of the page is far from complete too.]

Now here is what you can do to reproduce the bug:

1. Load the page
2. Look for the inline markup/script in Script tab of FB
3. Go ahead and click Random Choices button, then Break It Down For Me button after it appears.  I don't believe step 3 is really required at all anyway
4. Reload the page (F5):  I would do this after an edit to the page in a separate editor (RJ Text Edit) to put in the new script.

    The Script tab then changes to show in my FF/FB panes a single code line (#1) which is intializePage().
            This clearly refers to the call in the body onload attribute value (line 584 in the document), not the function defintion on line 50 of the doc.
           The script runs of course:  it just doesn't show under the Script tab with any of the markup.

Perhaps you have seen this before and know what's happening.

Sebastian Zartner

unread,
Aug 3, 2014, 10:27:44 AM8/3/14
to fir...@googlegroups.com
Thanks for the detailed description and the test case. I saw that on another page before and reported this now in issue 7615.
As far as I saw it was working in Firebug 2.0.1, so if you don't want to wait until the issue is fixed, you can revert to that version. (Note: You need to turn off automatic updates within the Add-on Manager then to avoid getting updated to 2.0.2 again. But ensure you follow the issue, otherwise you won't get the fixed version when it's out.)

Sebastian
Reply all
Reply to author
Forward
0 new messages