Jump to content

in Firefox, embedded js works in Fedora-27, but not windows-7

Recommended Posts


I have some HTML in which I've embedded some JavaScript.  In Firefox-62, it works on a Fedora-27 workstation as I want, but on a windows-7 box, the browser seems to act as if the script does not exist.  Here is an HTML extract showing the embedded JavaScript:

      <td style="padding: 0;">
         <img id="BianqingPic" src="x" alt=""/>

<p id="BianqingCaption"  class="photocaption">

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<script type="text/javascript">

   "use strict";

   var newPic = "BianQing_";
   var d = new Date();
   // picture choice is based on deci-hours (1 deci-hour = 6 minutes).
   // all_minutes = (60 * hours) + minutes; range is 0 to 1439.
   // (day-of-month - 1) is then added to throw this "out of sync" with the
   //    ErHu picture choice; range is 0 to 1469.
   // deci-hours = all_minutes / 6; range is 0 to 244.
   var all_minutes = (d.getMinutes() + (60 * d.getHours())) +
                     (d.getDate() - 1);
   var picnum = (Math.floor ( all_minutes / 6  ) % 7) + 1;
   document.getElementById ( "BianqingCaption" ).innerHTML =
        "Biān Qìng" + "&nbsp&nbsp(picture #" + picnum + " of 7; " +
        "based on deci-hours)";
   newPic = newPic + picnum + ".jpg";
   document.getElementById("BianqingPic").src = newPic;


I tried adding "console.log" statements just after the "use strict;" line, and between the last two lines of the script body.  Absolutely nothing shows up in the web console or the browser console.  Why is the script (apparently) being ignored?  The windows-7 and the Fedora-27 systems were updated last week, as was Firefox.

By the way,  the w3schools page "https://www.w3schools.com/js/js_debugging.asp" is out of date.  Firefox no longer uses Firebug, and the web site pointed to by the link provided for getting Firebug no longer exists.

Thank-you in advance for your help.


Share this post

Link to post
Share on other sites

If there are no messages at all in the console, then maybe the browser is using a tighter security policy where it doesn't run the script at all.

Share this post

Link to post
Share on other sites

Thank-you for your response.

Well, I can't explain it, but now it works as desired.  I didn't do anything but reboot and try it on different days!

Don't you just love it when problems mysteriously fix themselves or disappear?!


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...