How to migrate to standalone in angular

I have question how to migrate to standalone if I want that:

  1. In ApplicationConfigService I want use httpclient How I can do it?
  2. After Init app I want use load function

export function initializeFn(jsonAppConfiguration: ApplicationConfigService){
  return () =>{
    return jsonAppConfiguration.load();
  };
}

Please check following codes

export abstract class AppConfiguration{
    baseUrl:string = '';
    connectionName:string = '';
}

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { AppConfiguration } from './app-config'
import { DOCUMENT } from '@angular/common';
import { Inject } from '@angular/core';

@Injectable({providedIn: 'root'})
export class ApplicationConfigService extends AppConfiguration{

  constructor(@Inject(DOCUMENT) private document: Document, private http: HttpClient) { 
    super();
  }


  load(){
    try{
    
      this.connectionName = (this.document.getElementsByName("connectionName")[0] as any).value;
      this.baseUrl = (this.document.getElementsByName("baseUrl")[0] as any).value;
    }
    catch{}
  }
}


import { APP_INITIALIZER, Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { ApplicationConfigService } from './config/application-config.service';
import { HttpClientModule } from '@angular/common/http';


export function initializeFn(jsonAppConfiguration: ApplicationConfigService){
  return () =>{
    return jsonAppConfiguration.load();
  };
}

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [
    RouterOutlet,
    HttpClientModule
  ],
  providers: [
    ApplicationConfigService,
    {
      provide:APP_INITIALIZER,
      multi:true,
      deps:[ApplicationConfigService],
      useFactory:initializeFn
    }
  ],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss'
})
export class AppComponent {
  title = 'f_project';
}

import { HttpClient, HttpClientModule } from '@angular/common/http';
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ApplicationConfigService } from '../config/application-config.service';

@Component({
  selector: 'app-main',
  standalone: true,
  imports: [],
  templateUrl: './main.component.html',
  styleUrl: './main.component.scss'
})
export class MainComponent implements OnInit{


  public ConnectionName: string = '';



  constructor(private route: ActivatedRoute, private http: HttpClient, private AppConfig: ApplicationConfigService, private cdr: ChangeDetectorRef) {
    this.ConnectionName = AppConfig.connectionName;
  }

  ngOnInit(): void {
    console.log("ConnectionName: " + this.ConnectionName);
  }
}


Invalid Cyrillic filename in chrome.downloads.download in Linux

I get Error: Invalid filename when I try to download any file with Cyrillic name in my Google Chrome Extension by chrome.downloads.download. It works fine in Windows, but it does not work in Fedora Linux 39 Workstation. If I change my OS locale to Belarusian — I get the same error.

Do you have any suggestions how to fix it?

It is a simple code in background script:

chrome.downloads.download({
    url : e.data.link,
    filename : name,
});

How can i stop triggering component that is added to DataTable when i used .destroy() function?

I have added custom component in datatable.

Here is custom component:
enter image description here

Here is js code:

function customizeSeeteleDatatable()
        {
            //Removed default search box
            $('#seeteledatatable_filter').remove();
            $(".row").find(".col-md-6").removeClass("col-md-6");
            const search_component = '<div class="customize-tan-search" style="display:flex; width:100%; margin-bottom:10px;"><select class="form-control search_tan1"><option value="">Select Attribute</option></select><input type="text" placeholder="Search data" class="form-control search_tan1_value">'
                                    + '<select class="form-control search_tan2"><option value="">Select Attribute</option></select><input type="text" placeholder="Search data" class="form-control search_tan2_value">'
                                    + '<select class="form-control search_tan3"><option value="">Select Attribute</option></select><input type="text" placeholder="Search data" class="form-control search_tan3_value">'
                                    + '<button class="btn btn--dark tansearch" style="margin-left:10px; line-height:0;">Search</button><button class="btn btn--dark cleartansearch" disabled style="line-height: 0">Clear</button></div>'
            $('#seeteledatatable_length').append(search_component);
            $('#seeteledatatable_length').css({'display': 'flex'});
            $('select[name="seeteledatatable_length"]').css('width', '60px');
            $('#seeteledatatable_length *').css({ 'font-size': '12px', 'height': '25px' });
            $('.tansearch, .cleartansearch').css({ 'padding': '12px' });
            $('.search_tan1, .search_tan2, .search_tan3').css({'padding': '0', 'margin-left':'5px', 'margin-right':'2px'})
    
            const export_button = '<div class="col-md-4" style="text-align: center; align-self:center"><button class="btn btn--dark tanexport" disabled>Export Data</button></div>'
            $('#seeteledatatable_wrapper').children().eq(2).children().eq(0).removeClass('col-md-5').addClass('col-md-3');
            $('#seeteledatatable_wrapper').children().eq(2).children().eq(1).removeClass('col-md-7').addClass('col-md-5');
            $('#seeteledatatable_wrapper').children().eq(2).children().eq(0).after(export_button);
            getFromIndexedDbSession("ctc_tan_data").then((data) => {
                if (data) {
                    const tanDataHeader = Object.keys(data[1][0]['tan_data'][0]);
                    for (let i = 0; i < tanDataHeader.length; i++)
                        $('.search_tan1, .search_tan2, .search_tan3').append('<option value="' + tanDataHeader[i] + '">' + tanDataHeader[i] + '</option>');
                    if(tan_data_search)
                    {
                        var data = cloneObject(datatable_data['ctc_tan_data_page_search'])
                        var payload = data[0]
                        $('.search_tan1').val(payload.attribute1);
                        $('.search_tan1_value').val(payload.attribute1_value);
                        $('.search_tan2').val(payload.attribute2);
                        $('.search_tan2_value').val(payload.attribute2_value);
                        $('.search_tan3').val(payload.attribute3);
                        $('.search_tan3_value').val(payload.attribute3_value);
                        $('.cleartansearch').prop('disabled', false);
                    }
                    $('.loaderimage').hide();
                }
                else
                {
                    $('.loaderimage').hide();
                }
              });
    
    }
         
    function seeteledata_render(data) {
                var tanDataHead = ''
                var tanRowData = ''
                $('#seeteledatatable').DataTable().destroy();
                $('#deploymentiddetail').DataTable().destroy();
                if (!data || !data[0]['tan_data'].length) {
                        $('#tandataheader').empty();
                        var tanDataHead = "<table><tr><td>No Data</td></tr></table>";
                        var cleanedTag = purifyDOM(tanDataHead);
                        $('#tandataheader').html(cleanedTag);
                        $('#tanrowdata').empty();
                        var tanRowData = "<table><tr><td>No Data</td></tr></table>";
                        cleanedTag = purifyDOM(tanRowData);
                        $('#tanrowdata').html(cleanedTag);
                        $('#seeteledatatable').DataTable({ "searching": false });
                        customizeSeeteleDatatable();
                    return;
                }
                const tanDataHeader = Object.keys(data[0]['tan_data'][0]);
                for (var head = 0; head < tanDataHeader.length; head++) {
                    tanDataHead += '<th style="width: 10%">' + tanDataHeader[head] + '</th>'
                }
                $('#tandataheader').empty()
                tanDataHead = "<table><tr>" + tanDataHead + "</tr></table>"
                var cleaned_tag = purifyDOM(tanDataHead)
                $('#tandataheader').html(cleaned_tag)
                $.each(data[0]['tan_data'], function (index, element) {
                    var rowElements = ''
                    var rowStart = '<tr>'
                    var rowElements = "<td>" + "Data" + "</td>";
                    var rowEnd = '</tr>'
                    tanRowData += rowStart + rowElements + rowEnd
                });
                $('#tanrowdata').empty()
                tanRowData = "<table>" + tanRowData + "</table>"
                var cleaned_tag = purifyDOM(tanRowData)
                $('#tanrowdata').html(cleaned_tag)
                $('#seeteledatatable').DataTable({
                    "lengthMenu": [10, 20, 50, 100],
                    "pageLength": 10,
                    "initComplete": function (settings, json) {
                        $("#seeteledatatable").wrap("<div style='overflow:auto; width:100%;position:relative;'></div>");

                },
                "oLanguage": {
                    "sInfo": "Showing _START_ to _END_ entries",
                    "sLengthMenu": "Show _MENU_"
                },
            });
            customizeSeeteleDatatable();
    
        }

$(document).on('click', '.pagination a', async function(event) {
     data = [];    
     seeteledata_render(data);
});

Here is problem:

I have to destroy table and reinitiate table on every page number click because i am using backend pagination that calls an API on every page number click. And data rendered in custom component is static and comes from Indexeddb. Due to more data that should render in custom component, its taking more time when i click on new page number.

How can i preserve custom component when i use $('#seeteledatatable').DataTable().destroy(); so that its dont re-render every time i click on new page number ?

how can i solve this problem??.

Javascript getattribute from each element in array

i have this code and i want to get a new array with the href attribute of each element in the array; maybe there is a different way to do it

let countries = document.querySelectorAll('.el');
let countriesList = Array.prototype.slice.call(countries);
let arra = countriesList.map(link);
function link() {
   for(let i = 0; i < countriesList.length; i++) {
      countriesList[i].getAttribute('href');
   }  
}
console.log(arra)
<div>
  <a class='el' href='italy.php'>Italy</a>
  <a class='el' href='france.php'>France</a>
  <a class='el' href='japan.php'>Japan</a>
  <a class='el' href='china.php'>China</a>
</div>

MudTooltip doesn’t always disappear when cursor moves away

I am using MudTooltip in a Blazor web app (.NET 8, MudBlazor 6.18.0, Chrome).

When I hover over the menu icon, the tooltip appears.

Right-click the same menu icon and open it in a new tab.

Go back to the original tab and the tooltip is still there, even when not hovering over it.
Sometimes, I got the same bug with left-click.

Is this a bug of MudBlazor/MudTooltip? Any way to fix it permanently/temporarily?

enter image description here

Select2 X button missing ver [email protected]

Hello I’m Regan I am developing website using laravel 10. As you can see in my screenshot the x button is missing. The first time I implement this its working fine, but after months, when I came back to the page, it happens.
Missing x button to unselect

Here are the script of my select2 maybe it helps. I wanted to append an HTML to a div when selected a data from guidebooksData. I also check my console it doesn’t have any errors. Have anyone met this problem before?

<script>
            $(document).ready(function() {
                $('#dropDownSelectBooks{{$pricing->id}}').select2({
                    placeholder:'{{__("search-guidebook")}}',
                    maximumSelectionLength: {{$pricing->total_guidebook}}
                });

                // Function to update selected guidebooks
                function updateSelectedGuidebooks() {
                    var selectedGuidebooksContainer = $('#selected-guidebook{{$pricing->id}}');
                    var selectedGuidebooks = $('#dropDownSelectBooks' + currentSectionId).select2('data');
                    selectedGuidebooksContainer.empty();
                    var count = 1;

                    selectedGuidebooks.forEach(element => {
                        // Loop through guidebooksData to find the guidebook with the matching ID
                        var dataId = element.id.trim();
                        for (var i = 0; i < guidebooksData.length; i++) {
                            if (guidebooksData[i].id == dataId) {
                                // Create HTML elements to represent the guidebook
                                var guidebookHTML = '<div class="block">';
                                guidebookHTML += '<h3>Guidebook ' + count + '</h3>';
                                guidebookHTML += '<div class="book">';
                                guidebookHTML += '<div class="img" style="background: url('' + guidebooksData[i].thumbnail + '') no-repeat;"></div>';
                                guidebookHTML += '<div class="desc">';
                                guidebookHTML += '<p>Guidebook</p>';
                                guidebookHTML += '<h3>'+ guidebooksData[i].title +'</h3>';
                                guidebookHTML += '<span>by ' + guidebooksData[i].user.first_name + '</span>';
                                guidebookHTML += '</div>';
                                guidebookHTML += '</div>';
                                guidebookHTML += '</div>';
                                
                                // Append the guidebook HTML to selectedGuidebooksContainer
                                selectedGuidebooksContainer.append(guidebookHTML);
                                break; // Exit the loop since the guidebook has been found
                            }
                        }
                        count = count + 1;
                    });
                }

                // Event listener for dropdown change
                $('#dropDownSelectBooks{{$pricing->id}}').on('change', function (e) {
                    updateSelectedGuidebooks();
                });
            });
        </script>

I have tried to search any missing x button in stackoverflow but it’s not the same problem as me. I also have tried to remove my functions but still its not working. Any ideas how to make it appear?

How can modify transformation in material design js file?

I have cloned this repository material design

In the catalog folder of this project catalog, at the path of /scripts/copy-docs.mjs, the following command remove some specific comments from md files.

const transforms = [
  // catalog-only code comments are removed
  {
    before: /<!-- catalog-only-start -->(n)*?<!--s*/gm,
    after: '',
  },
  {
    before: /s*-->(n)*?<!-- catalog-only-end -->/gm,
    after: '',
  },
  // removes everything in between github-only-start and github-only-end
  // comments
  {
    before: /s*<!-- no-catalog-start -->(.|n)*?<!-- no-catalog-end -->s*/gm,
    after: 'nn',
  },
  // eleventy pages end with `/` so `components/checkbox.md` will turn into the
  // url `/components/checkbox`. Thus we need to transform the relative
  // `./images` links to `../images`.
  {
    before: /images//gm,
    after: '../images/',
  },
];

async function fileIncludeTransform(filepath, fileContents) {
  const catalogIncludeRegex = /<!--s?catalog-include "(.+)"s?-->/g;
  const matches = [];
  let match = catalogIncludeRegex.exec(fileContents);

  // Collect all the regex matches
  while (match) {
    matches.push(match);
    match = catalogIncludeRegex.exec(fileContents);
  }

  const fileDir = dirname(filepath);

  // Iterate through the regex matches backward and splice in the file contents.
  // Iterating backwards so that injecting won't affect match string indices.
  for (let i = matches.length - 1; i >= 0; i--) {
    const match = matches[i];
    const matchedString = match[0];
    const includePath = match[1];

    console.log(`Injecting ${includePath} file contents into ${filepath}...`);
    const includeContents = await readFile(join(fileDir, includePath), 'utf8');

    fileContents = fileContents.slice(0, match.index) + includeContents +
        fileContents.slice(match.index + matchedString.length);
  }

  return fileContents;
}

async function transformReadmes(filepaths, outdir = '', replacements = []) {
  const readmePromises = filepaths.map(async (entry) => {
    let readme = await readFile(entry, 'utf8');
    console.log(`Transforming ${entry}`);

    transforms.forEach((transform) => {
      readme = readme.replaceAll(transform.before, transform.after);
    });

    readme = await fileIncludeTransform(entry, readme);

    // The `components/<component-name>.md` path.
    let localPath = relative(join('..', 'docs'), entry);

    for (const [pattern, replacement] of replacements) {
      const regex = new RegExp(pattern);
      localPath = localPath.replace(regex, replacement);
    }


    // The output path at
    // /catalog/site/components/<?local path>/<component name>.md
    const outputPath = join('site', outdir, localPath);

    console.log(`Writing trasnformed file to: ${outputPath}`);
    return writeFile(outputPath, readme);
  });

  await Promise.all(readmePromises);
}

When i build the project, these pieces of codes does not remove specific comments from found files. I have this problem in windows, not linux based systems.
How can modify this transformation in windows?

In Boostrap 4 how can I change the the translucency of toasts to fully opaque?

I am using Boostrap 4.6 (and I cannot upgrade to BS 5 yet). How can I change the translucency of toasts to fully opaque?

My toast looks like this:

    <div id="help" style="position: fixed; top: 0.5vw; bottom: 0.5vw; right: 10vw;">
        <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
            <div class="toast-header">
                <strong class="mr-auto">Help for <%=systemName%></strong>
                <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="toast-body">
                hallo
                <!-- <zero-md src="help/hallswell_all_towers.md"></zero-md> -->
            </div>
        </div>
    </div>

I tried to add in our CSS style sheet (which is loaded after the Bootstrap CSS) the following:

.toast {
  opacity: 1;
}

but this does not have the desired effect.

So, how can I change the translucency of toasts?

Publishing a npm module but it’s not getting text predict (intellisense) when installed by users

I’m currently working on my package @xatsuuc/startonomy.

For some reason, it’s not getting intellisense when I’m installing it on user side. Below are my files. When I install the package and go to node_modules/@xatsuuc/startonomy it shows the .d.ts files but for some reason not a single bit of text predict works. Also, any suggestions for it? I don’t know if I’m doing things right when compiling on the user’s pc, or if I’m exporting modules correctly. Thanks in advance.

tsconfig.json

{
  "compilerOptions": {
    "target": "ESNext",
    "resolveJsonModule": true,
    "module": "commonjs",
    "lib": [],
    "allowJs": true,
    "declaration": true,
    "outDir": "./compiled",
    "rootDir": "./src",
    "removeComments": false,
    "moduleResolution": "node",
    "rootDirs": ["./src"],
    "types": ["@types/mysql", "@types/node"],
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": [
    "./src/**/*"
  ],
  "exclude": []
}

package.json

{
  "name": "@xatsuuc/startonomy",
  "version": "2.0.0-Gamma",
  "description": "A discord-based economy system",
  "main": "compiled/index.js",
  "repository": "https://github.com/xAtsuUC/Startonomy.git",
  "author": "Tiziano Fioretti <[email protected]>",
  "license": "CC BY-SA 4.0",
  "private": false,
  "dependencies": {
    "mysql": "^2.18.1"
  },
  "files": [
    "src",
    "README.md",
    "tsconfig.json"
  ],
  "devDependencies": {
    "@types/mysql": "^2.15.26",
    "@types/node": "^20.11.30",
    "@typescript-eslint/eslint-plugin": "^7.3.1",
    "@typescript-eslint/parser": "^7.3.1",
    "eslint": "^8.57.0",
    "typedoc": "^0.25.12",
    "typedoc-material-theme": "^1.0.2",
    "typescript": "^5.4.3"
  },
  "publishConfig": {
    "registry": "https://registry.npmjs.org/",
    "access": "public"
  },
  "scripts": {
    "preinstall": "npm i typescript",
    "install": "tsc",
    "postinstall": "npm uninstall typescript"
  }
}

GuildManager.ts

import { Pool, ConnectionConfig } from "mysql"
import { EventEmitter } from "node:events"
import Util from "./Util"

/**
 * Guild Manager
 * @class GuildManager
 * @extends EventEmitter
 * @param {ConnectionConfig} database - The database connection configuration
 * @example
 * const economy = new guildManager({
 *     host: "localhost",
 *     user: "root",
 *     password: "password",
 *     database: "database"
 * });
 */
class GuildManager extends EventEmitter {
    database: ConnectionConfig
    util: Util
    constructor(database: ConnectionConfig) {
        super()
        this.database = database
        this.util = new Util()
    }

    public test() {
        console.log("Test")
    }
}

export default GuildManager

index.ts

import GuildManager from "./GuildManager"
import Util from "./Util"

module.exports = { GuildManager, Util }

EJS is not being rendered

index.js

import express from "express";
import bodyParser from "body-parser";

const app = express();
const port = 3000;

app.set("view engine", "ejs");

app.use(bodyParser.urlencoded({ extended: true }));

app.get("/", (req, res) => {
  res.render("index.ejs");
});

app.post("/submit", (req, res) => {
  const numLetters = req.body["fName"].length + req.body["lName"].length;
  res.render("index.ejs", { numberOfLetters: numLetters });
});

app.listen(port, () => {
  console.log(`Server running on port ${port}`);
});


index.ejs

   <!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Name Letters</title>
</head>

<body>
  <!-- Write your code here -->
  <h1>Write your name below</h1>
  <% if(locals.numberOfLetters){ %>
    <h1>There are <%= numberOfLetters %> letters in your name.</h1>
    <% } %>
      <form action="/submit" method="POST">
        <input type="text" name="fName" placeholder="First name">
        <input type="text" name="lName" placeholder="Last name">
        <input type="submit" value="OK">
      </form>
</body>

</html>

OUTPUT
File Hierarchy

Can someone help me? I have installed all the required libraries.

It’s not a big problem so I have tried whatever I could find on the internet.
My previous activity was successfully rendered and I did nothing different this time.

Filtering output on AWS State Machine

I’m currently stuck on how to filter the output from the previous step in my state machine.
Say the previous step in the state machine has an output of:

"input": {
"Configuration": [
  {
    "Hours billed": "40",
    "Billing class": "A", 
    "Taxonomy": "261QB0400X",
  },
  {
    "Hours billed": "40",
    "Billing class": "B",
    "Taxonomy": "261QB0400X", 
  },
  {
    "Hours billed": "20",
    "Billing class": "C", 
    "Taxonomy": "261QR1300X",
}
]}

Is there to filter that output? Say the filter is “Taxonomy”: “261QB0400X”, and we want the answer to look like this:

"Configuration": [
  {
    "Hours billed": "40"
    "Billing class": "A" 
    "Taxonomy": "261QB0400X",
  },
  {
    "Hours billed": "40",
    "Billing class": "B"
    "Taxonomy": "261QB0400X",
  }
]

I have tried using ResultSelector, Parameter, and OutputPath. But I haven’t had much success.

I would love your insight on how I should write the next step/how to filter the data out by using a specific Taxonomy coming from the front-end.

Thank you

Login form validation with jsf with javascript , create alert

I am trying to duplicate a program with primefaces and I need to show alert windows when validating the username and password fields of my login form.
Next I show you how the first program looks like
enter image description here

In my duplicated program that I don’t use primefaces I don’t know how to show the same alert result with bootstrap and javascript.
Next I show you the form of my duplicated program:
enter image description here

Currently I am not validating fields as I need to first show the alert as many times as I want by pressing the button, here the xhtml code:

<div class="col-6 position-absolute">
    <div id="alertMessage"
        class="alert alert-warning alert-dismissible fade show hidden"
        role="alert">
        <strong>Holy guacamole!</strong> You should check in on some of those
        fields below.
        <button type="button" class="btn-close" data-bs-dismiss="alert"
            aria-label="Close"></button>
    </div>
</div>

<div class="bg-white p-4 rounded-5"
    style="box-shadow: 2px 2px 5px black;">
    <div class="justify-content-center">
        <img src="recursos/images/logo_empresarial.png" class="mb-1"></img>
    </div>
    <h:form id="formLogin">

        <div class="text-center mt-2">
            <h:outputLabel for="username" value="Usuario:"></h:outputLabel>
            <h:inputText id="username" value="#{obeanlogin.usuario}"
            required="true" requiredMessage="Ingrese un usuario"
                class="form-control" />
        </div>

        <div class="text-center mt-2">
            <h:outputLabel for="password" value="Password:"></h:outputLabel>
            <h:inputText id="password" value="#{obeanlogin.contrasena}"
                class="form-control" />
        </div>

        <div class="text-center mt-4">
            <h:commandButton id="submitLogin" class="btn btn-primary"
            onclick="return sendForm();"
                value="Aceptar" action="#{obeanlogin.validaUsuarioContrasena()}" />

        </div>


    </h:form>

</div>

And my javascript code:

var form = document.getElementById('formLogin');
var username = document.getElementById('formLogin:username');
var password = document.getElementById('formLogin:password').value;
var alerta = document.getElementById('alertMessage');
var closeButton = document.querySelector('.alert .btn-close');

function sendForm() {
 alerta.classList.remove('hidden');
 console.log('se abrió ventana');
 console.log(alerta);
 return false;
}

/*closeButton.addEventListener('click', function() {
console.log(alerta);
alerta.classList.add('hidden'); // Oculta el alerta al añadir la clase 'hidden'
});*/


alerta.addEventListener('close.bs.alert', event => {
 alerta.classList.add('hidden');
 console.log('close close');
 console.log(alerta);
})

Quiero saber como puedo lograr la misma ventana de mi primer programa con los campos vacíos, además de validar el usuario y contraseña incorrectos con la función de mi bean

How to host private files on github and link them in public html website? [duplicate]

i made a web game with html, css, javascript and published it in blogger.com but the problem is that anyone can open inspector and copy my code. how to make private files in github, and link them in my html, for example script.js, and so that users will not be able to copy or see the code of my script.js file through inspector, but that the game will still work fine and be public?

i tried to link the github script.js private file with the game logic in it in the html public website game, i didnt expect it to work, and it didnt

DataTables: (TypeError) m[v] is undefined

Trying to set up a DataTable with data provided as JSON by PHP.

function request_data() {                    
    $.ajax({
        url: './inc/get_data.php?mode=1',
        method: 'POST',
        data: $("#frmMain").serialize(), // Serialize form data
        dataType: 'json',
        success: function(baseData) {
            makeDataTable(baseData);
        }
});
}

function makeDataTable(new_data) {
    console.table(new_data);
    $('#table_log').DataTable({                        
        columns: [
            { data: 'id' },
            { data: 'zeitstempel' },
            { data: 'tag' },
            { data: 'message' },
            { data: 'file' }
        ],
        data: new_data
    });
}

The result from get_data.php in DevConsole looks like:

05:37:52.373 new_data
05:37:52.403
Array(3) [ {…}, {…}, {…} ]​
0: Object { id: "3", zeitstempel: "2024-03-24 21:32:49.525789+01", tag: "#1", … }​
1: Object { id: "2", zeitstempel: "2024-03-24 19:50:17.568385+01", tag: "tag1", … }​
2: Object { id: "1", zeitstempel: "2024-03-24 19:49:44.23372+01", tag: "tag1", … }​

An empty DataTable is visible, and getting error:

TypeError: m[v] is undefined