Showing questions tagged:

Template literal not resolving as expected

I have a directory structure C: Gustafson Website ⋮ scripts global.js ⋮ ⋮ TestDirector… (read more)

I have a directory structure

C:

   Gustafson
       Website
           ⋮
           scripts
               global.js
               ⋮
           ⋮
           TestDirectory
               baseUrl_test.html
           ⋮

In the <head> of a webpage, I determine a baseUrl for the page using the following:

 <script>
   // assumes website topmost directory is "Website""
   ( async ( ) => {
     const segments = document.documentURI.split ( "/");
     const index = segments.findIndex ( element => 
                                        element == "Website" );
     if ( index < 0 )
       {
       throw new TypeError ( 
                 "Website structure not constructed correctly" );
       }
     segments.length = index + 1;
     let path = segments.join ( "/" );
     path += "/";
     window.baseUrl = path;
     console.log(`${baseUrl}`);
     } ) ( );
 </script>

The console log displays

file:///C:/Gustafson/Website/

In the body is

 <script>
   console.log ( `${baseUrl}scripts/global.js` );
 </script>
 <script src=`${baseUrl}scripts/global.js`></script>
 <script>
 window.onload = 
   function ( )
     {
     Global.initialize_globals ( );
     };
 </script>

The console log displays

file:///C:/Gustafson/Website/scripts/global.js Loading failed for the <script> with source “file:///C:/Gustafson/Website/TestDirectory/%60$%7BbaseUrl%7Dscripts/global.js%60”. Uncaught ReferenceError: Global is not defined

   onload file:///C:/Gustafson/Website/TestDirectory/baseUrl_test.html:37
   EventHandlerNonNull* file:///C:/Gustafson/Website/TestDirectory/baseUrl_test.html:34

The problem is the console.log displays what is expected but the src= is using something totally different.

Open 12

stop unwanted pop ups dev FF w11

Hello: FF dev 150b5,w11p. With this v 150 there's a new irritant that I would like to stop, please. That's the sudden (starting w/v150 again) appearance on lower L corner… (read more)

Hello: FF dev 150b5,w11p. With this v 150 there's a new irritant that I would like to stop, please. That's the sudden (starting w/v150 again) appearance on lower L corner, of a popup window, which may be interactive. That is, this thing is so new I can't say more about it except that I didn't change anything to make this thing appear, & this didn't happen in prev.versions.

I looked in settings & the only thing on keyword "popup" goes to, in "search results", is: "block popups & 3rd party redirects." I already had that choice checked from previous versions (that is, do block). But this new popup appeared (unasked) anyway.

Is there an extension that will stop these? If so, what keyword(s) do I put into the "search extensions" box to find the extension(s)?

Also, w/this new "wonder" of unasked-for popups -- is this another "coming w/AI" feature I will have to live with?

I did a search here on "popups" before posting,but came up w/nothing relevant.

Thank you.


/edit:fixed a formatting issue causing horizontal scrolling

Open 3 31