react google maps clustering for one marker

I faced a problem using a @googlemaps/markerclusterer and @vis.gl/react-google-maps libraries that I cant cluster only one marker no matter what approach I used. Right now clustering part looks like this:

  useEffect(() => {
    if (!map) return;

    clusterer.current = new MarkerClusterer({
      map,
      markers: [],
      algorithm: new SuperClusterAlgorithm({
        minPoints: 1,
      }),
    });

    return () => {
      if (clusterer.current) {
        clusterer.current.clearMarkers();
        clusterer.current = null;
      }
    };
  }, [map]);

  const memoizedMarkers = useMemo(() => markers, [markers]);

  useEffect(() => {
    if (!clusterer.current || !map) return;

    const markerElements = Object.values(markersRef.current);
    clusterer.current.clearMarkers();
    clusterer.current.addMarkers(markerElements);
  }, [map, memoizedMarkers]);

Can someone help me please to find a way how to cluster only one marker.

I went to documentation and havent found the correct answer, I tried:

  clusterer.current = new MarkerClusterer({
    map,
    markers: [],
    algorithm: new SuperClusterAlgorithm({
      minPoints: 2, // Changed from 1 to 2
    }),
  });

but it didnt work

Why can component names in Vue only be shadowed by non-default exports?

I have a simple App, that only renders my TestComp. In the setup context of App.vue, there is also a ref called testComp. Even though I am not using the recommended Template Expression of <TestComp /> (and instead <test-comp />), everything renders fine.

<!-- App.vue -->

<script setup>
import { ref } from 'vue'
import TestComp from './TestComp.vue'

const testComp = ref(null)

</script>

<template>
  <div>
    <test-comp />
    <!-- Recommended is <TestComp />, and this avoids the issue, but not the focus here -->
  </div>
</template>
<!-- TestComp.vue -->
<script setup>

</script>
<template>
  <div>
    I am a test component.
  </div>
</template>
// components.ts
import TestComp from './TestComp.vue'
// supposed to group multiple component definitions together
export {
  TestComp
}

Vue SFC Playground

So the Template Expression <test-comp /> is evaluated as the imported component TestComp and not my variable testComp.

Instead of importing TestComp directly, we can use a file that is grouping my component definitions by importing and re-exporting them in an object. We can achieve that by replacing the import:

from: import TestComp from './TestComp.vue'

to: import { TestComp } from './components.ts'.

Now the Template Expression <test-comp /> seems to be evaluated to the ref testComp, and I get a warning: [Vue warn]: Invalid vnode type when creating vnode: null – the component is not rendered.


Why is there a difference between TestComp being imported directly, and being part of another files non-default export?

how to detect click in dom programatically [closed]

I have an input field with an onBlur event that triggers a temp() method when the user leaves the field. There’s also a Save button, and when the Save button is clicked manually, the input field loses focus (triggers blur) automatically, which calls the temp() method, followed by the Save operation.

However, when using a keyboard shortcut, I cannot call the Save method directly. Instead, I have to simulate a button click programmatically. In this case, the input field does not lose focus, so the onBlur event is not triggered, and the temp() method doesn’t execute. How can I ensure the onBlur event is triggered when the Save button is clicked programmatically via a keyboard shortcut?
in angular

i only tried this way

Issues with Handling setupIntervalButton() in refreshFetch() Function for Weather Map API

I’m currently working on a weather map API and encountering an issue with my setupIntervalButton() function when trying to use it in the refreshFetch() function. Specifically, I’m having trouble ensuring that the button is properly rendered and the interval is correctly set up before the refreshFetch() function is executed.

Here’s the code for setupIntervalButton():

function setupIntervalButton(input,select,button){
    console.log('Setting up event listener'); // Debugging line
    console.log('Button element inside setup:', button); // Debugging line
    
    button.addEventListener('click', () =>{
        const intervalValue = input.value;
        const selectedInterval = select.value

        if (!intervalValue && !selectedInterval) {
            alert("Please provide numeric value and select interval type");
        } else if (!intervalValue) {
            alert("Please provide numeric value for interval");
        } else if (!selectedInterval) {
            alert("Please select interval type");
        } else{
            console.log(`Interval set to ${intervalValue} ${selectedInterval}`);
            
        }

        if(selectedInterval === "Seconds"){
            console.log(intervalValue)
            return intervalValue * 1000
        }
        else if(selectedInterval === "Minutes"){
            console.log(intervalValue)
            return intervalValue * 60000
        }
        else if(selectedInterval === "Hours"){
            console.log(intervalValue)
            return intervalValue * 60 * 60 * 1000
        }else{
            return intervalValue * 1000
        }

    })
}
function refreshFetch(){
    window.setInterval(() =>{
        fetchData()
        console.log('url fetched')
    },setupIntervalButton())

}

Issue: The main problem is that setupIntervalButton() is not rendering the button before the refreshFetch() function is executed. Consequently, the interval is not being set correctly.

You can see the JS Fiddle code here: https://jsfiddle.net/blaze92/u9zs2qy8/

Dev console Error

Questions:

1.How can I ensure that setupIntervalButton() properly sets up the interval before refreshFetch() is executed?

2.Is there a way to make setupIntervalButton() return the interval time so it can be used in refreshFetch()?

NPM Command Not Recognized Despite Installation-‘CALL “C:Program Filesnodejsnode.exe””C:Program Filesnodejsnode_modulesnpmbinnpm-prefix.js”‘

I’m encountering an issue with npm on my Windows machine. When I run npm –version in the command line, I get the following output:
C:Usersnares>npm –version
‘CALL “C:Program Filesnodejsnode.exe” “C:Program Filesnodejsnode_modulesnpmbinnpm-prefix.js”‘ is not recognized as an internal or external command,
operable program or batch file.
10.8.2

Reinstalling Node.js and npm multiple times.
Checking the PATH environment variable to ensure it includes the paths to Node.js and npm.
Running the command prompt as an administrator.
Clearing the npm cache with npm cache clean –force

Has anyone encountered this issue before? Any advice or solutions would be greatly appreciated.

Thank you!

Micro Frontend with React and a normal html/css/js

I am trying to implement Micro Frontend Architecture where the html/css/js application is the main application and the React application must be embedded inside it.
I don’t want to implement it using iframes.

const App = () => {

    const navigate=useNavigate();
    const location=useLocation();
    
    const logout=()=>{
        localStorage.removeItem("name");
        Cookies.remove("token");
        localStorage.removeItem("groupId");
        navigate("/");
    }

    return (
        <>
            {location.pathname!=="/" && location.pathname!=="/register" && 
                <>
                    <button onClick={logout}>Logout</button>
                    <select name='mytenants' id='mytenants'>
                        
                    </select>
                </>// marked
            }
            <Routes>
                <Route path="/" element={<Login></Login>}></Route>
                <Route path="/message" element={<ProtectedRoute><WebSocketComponent></WebSocketComponent></ProtectedRoute>}></Route>
                <Route path="/register" element={<SignUp></SignUp>}></Route>
                <Route path='/message/:reciver' element={<ProtectedRoute><WebSocketComponent></WebSocketComponent></ProtectedRoute>}></Route>
                <Route path="/message/group" element={<ProtectedRoute><GroupChat></GroupChat></ProtectedRoute>}></Route>
                <Route path="/message/group/:group" element={<ProtectedRoute><GroupChat></GroupChat></ProtectedRoute>}></Route>
                <Route path="/registeruser" element={<ProtectedRoute><RegisterUser></RegisterUser></ProtectedRoute>}></Route>
            </Routes>
        </>
    );
};

export default App;

This is my App.js of my react application.

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <BrowserRouter>
      <App />
    </BrowserRouter>
  </React.StrictMode>
);

This is my Index.js

I tryed to wrap the App.js using the Web Component and the use it in my html/css/js application but it didn’t work out.

class ReactMicroFrontend extends HTMLElement
{
    connectedCallback()
    {
        const shadowRoot=this.attachShadow({mode:"open"});

        const mountPoint=document.createElement('root');
        shadowRoot.appendChild(mountPoint);

        ReactDOM.render(
            <React.StrictMode>
            <BrowserRouter>
                <App />
            </BrowserRouter>
            </React.StrictMode>
            ,
            mountPoint
        );
    }

    disconnectedCAllback()
    {
        ReactDOM.unmountComponentAtNode(this.shadowRoot.querySelector('root'));
    }
}

customElements.define('react-microfrontend', ReactMicroFrontend);

This was the wrapper component.

I don’t want to use any frameworks like Single-SPA to implement it.
I want to implement it using plain javascript.
Is there any possible way to achieve it?

std::regex is different than Javascript [duplicate]

I thought that std::regex was ECMAScript compatible. However, that does not seem to be true, at least not by default, e.g.

The expression :user will match asd:user in Javascript but not with std::regex while .*:user will match.

What is the cause for the difference and is there any flags or options I can pass to std::regex and/or std::regex_match to make std::regex behave exactly like Javascript RegExp?

I get a gas error when I try to mint a token

I am trying to estimate gas for the mint function in a smart contract I created.

      try {
        const gas = await publicClient.estimateContractGas({
          address: provider.token,
          abi: fiatAbi,
          functionName: 'mint',
          account,
          args: [
            `0x${p.userId}`,
            BigInt(p.settledAmount) * 10n ** BigInt(provider.decimals),
          ],
        })

Here is the minimized token contract code

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
...

abstract contract PepperBaseTokenV1 is
    Initializable,
    ERC20Upgradeable,
    ...
{
    ... 
    
    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    ...
    
    function _update(
        address from,
        address to,
        uint256 value
    ) internal virtual override(ERC20Upgradeable, ERC20PausableUpgradeable) whenNotPaused {
        require(!blockList[from], "Sender is blacklisted");
        require(!blockList[to], "Recipient is blacklisted");

        super._update(from, to, value);
    }
}

But everytime I try to mint or estimate gas I get this error.

{

  "details": "insufficient funds for transfer",

  "metaMessages": [

    "This error could arise when the account does not have enough funds to:",

    " - pay for the total gas fee,",

    " - pay for the value to send.",

    " ",

    "The cost of the transaction is calculated as `gas * gas fee + value`, where:",

    " - `gas` is the amount of gas needed for transaction to execute,",

    " - `gas fee` is the gas fee,",

    " - `value` is the amount of ether to send to the recipient."

  ],

  "shortMessage": "The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",

  "version": "2.21.3",

  "name": "InsufficientFundsError"

}

I know my wallet has enough eth for gas fee. From the error it seems the code is trying to send ETH. I am not sure why that is as the mint function takes two argument, to and value.

Netsuite PagedData inconsistencies

I have developed the following RESTlet in Netsuite to provide custom search results as API.

var 
    log,
    search,
    response = new Object();    

define( [ 'N/log', 'N/search' ], main );

function main( logModule, searchModule, searchSortModule ) {
    log = logModule;
    search = searchModule;
    search.Sort = searchSortModule;
    return { post: postProcess }
}

function postProcess(request) {
    try {
        if (typeof request.searchID === 'undefined' || request.searchID === null || request.searchID === '') {
            throw { 'type': 'error.SavedSearchAPIError', 'name': 'INVALID_REQUEST', 'message': 'No searchID was specified.' };
        }

        var searchObj = search.load({ id: request.searchID });
        log.debug('Search ID: ', request.searchID);

        // Add sorting by internalid in ascending order
        var internalIdSort = search.Sort.ASC;
        searchObj.columns.push(search.createColumn({
            name: 'internalid',
            sort: internalIdSort
        }));

        response.results = [];

        // Start from the last index if provided, else default to 0
        var start = (request.lastIndex && !isNaN(request.lastIndex)) ? parseInt(request.lastIndex) : 0;

        // Get the total record count using runPaged on search object
        var pagedData = searchObj.runPaged();
        log.debug('Total Record Count', pagedData.count);

        // Return the total record count
        response.totalRecords = pagedData.count;

        var results = [];
        var pageIndex = Math.floor(start / 1000);  // Calculate the starting page index
        var recordOffset = start % 1000;  // Calculate the record offset within the page

        log.debug('Starting at page:', pageIndex);
        log.debug('Starting at record offset:', recordOffset);

        // Fetch the starting page and subsequent pages if necessary
        for (var i = pageIndex; i < pagedData.pageRanges.length; i++) {
            var currentPage = pagedData.fetch({ index: i });

            // If starting in the middle of a page, skip the records before the offset
            var pageData = (i === pageIndex) ? currentPage.data.slice(recordOffset) : currentPage.data;

            pageData.forEach(function(result) {
                results.push(result);
            });

            // Update start for the next batch
            start += pageData.length;

            // Concatenate results
            response.results = response.results.concat(pageData);

            // Stop fetching if we reach 1000 results in this response
            if (response.results.length >= 1000) {
                response.lastIndex = start;
                break;
            }

            // If we've fetched all available records, stop
            if (start >= pagedData.count) {
                log.debug('End of records reached.');
                response.lastIndex = null; // Indicate no more records
                break;
            }
        }

        // If we fetched less than 1000 results and there are no more records
        if (response.results.length < 1000 && start >= pagedData.count) {
            response.lastIndex = null;
        }

        return response;

    } catch (e) {
        log.debug({ 'title': 'error', 'details': e });
        return { 'error': { 'type': e.type, 'name': e.name, 'message': e.message } };
    }
}

The script works as expected, with an index and pagination management. The main issue is the inconsistency between the total number of records returned by the RESTlet and the number of records I have in Netsuite for the given searchId. (For example, 83.228 records vs 130.245 in Netsuite)

Question: Where do the inconsistencies come from? PagedData should return the correct metadata, at least for the count.

Troubleshooting for CSS layout issue [duplicate]

I am facing some trouble in implementing the layout of a page that I am working on. I have attached a screenshot of the desired layout. The main element is the box in the bottom right showing tab-content and header; I want that box to take 50% of the visible right half.
This is the code snippet showing what I am attempting.

html,
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: lightcoral;
  height: 50px;
}

.main {
  background: blue;
  flex: 1;
}

.page {
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
}

.page-header {
  height: 50px;
  background: yellow;
}

.page-content {
  background: lightgoldenrodyellow;
  flex: 1;
  display: flex;
}

.element1 {
  background: lightgreen;
  width: 50%;
  height: 100%
  max-height: 100%;
  overflow-y: auto;
}

.element-1-content {
  height: 1000px;
}

.element2 {
  width: 50%;
  background: lightblue;
  display: flex;
  height: 50%;
  flex-direction: column;
}

.tab {
  background: lightslategrey;
  height: 20px;
}

.tab-content {
  flex: 1;
  background: lightpink;
}
<header class="header">
  <p>
    some header
  </p>
</header>
<main class="main">
  <div class="page">
    <header class="page-header">
      <p>
        page header
      </p>
    </header>
    <main class="page-content">
      <div class="element1">
        <div class="element-1-content">
          Element 1 content
        </div>
      </div>
      <div class="element2">
        <div class="tab">
          tab header
        </div>
        <div class="tab-content">
          tab content
        </div>

      </div>
    </main>

  </div>
</main>

Desired layout

How to go from mapped source to minified code

I need to find where a specific function in main.js.map is in the minified code main.js.

I tried to do it in Chrome dev tools, but that does not seem possible. Chrome directs me to the entire minified file, not to a specific location in the minified file.

I saw a method involving break points, but that would not work for my use case

I am happy to do it manually, with less, but I’m not sure how to do it.

Any pointer?

I cannot send a variable with multiple values in Jquery

I have a code that generates dynamically table rows and I want to make that whenever the user clicks on a row it sends that information to a function and it process it in a modal.

The thing is that I am having trouble passing information, I’ve tried everything I know, even passing ASCII the special characters such as ‘.’ or ‘_’ but still cannot manage to make it.

The error: Uncaught SyntaxError: Invalid or unexpected token (at AdminTab:1:14)

The program is taking the values as they were numbers and strings but I am parsing all of them to string always RESULT: acceptModal( 195Pending95User permission requested95gbilbao95gbilbao@gestamp46com95ES95Admin)

I provide the code of cshtml and jquery:

$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: '/AdminTab/ShowAllUserPetitions',
        error: function () {
            //alert("An error occurred.");
        },
        success: function (data, type, full) {          
            var IDPetition = {};
            var Status = {};
            var PetitionDate = {};
            var Description = {};
            var Username = {};
            var Email = {};
            var Domain = {};
            var Privilege = {};
            var newRowContent = ``;
            var newRowContentResolved = ``;
            var newRowContentUnResolved = ``;
            var counterUnResolved = 0;
            var counterResolved = 0;
            var counterConfirmed = 0;

            IDPetition = data.data.map(function (e) {
                return e.id_user_petition;
            });
            Status = data.data.map(function (e) {
                return e.petition_status;
            });
            PetitionDate = data.data.map(function (e) {
                return e.petition_date;
            });
            Description = data.data.map(function (e) {
                return e.petition_description;
            });
            Username = data.data.map(function (e) {
                return e.username;
            });
            Email = data.data.map(function (e) {
                return e.email;
            });
            Domain = data.data.map(function (e) {
                return e.domain;
            });
            Privilege = data.data.map(function (e) {
                return e.privilege;
            });

            let ASCIILowBar = "95";

            $.each(Privilege, function (key, value) {
                if (Status[key] == "Pending" || Status[key] == "Confirmed")
                {   
                    debugger;

                    sendUserRequest = IDPetition[key].toString() + ASCIILowBar + Status[key].toString() + ASCIILowBar + Description[key].toString() + ASCIILowBar + Username[key].toString() + ASCIILowBar + Email[key].toLocaleString() + ASCIILowBar + Domain[key].toString() + ASCIILowBar + Privilege[key].toString();

                    do {
                        let indexofDot = sendUserRequest.indexOf('.');
                        let asciiValueDot = sendUserRequest.charCodeAt(indexofDot);
                        sendUserRequest = sendUserRequest.replace('.', asciiValueDot);
                    } while (sendUserRequest.indexOf('.') != -1);


                    //const sendContent = [IDPetition[key].toString(), Status[key].toString()/*, Description[key], Username[key], Email[key], Domain[key], Privilege[key]*/];
                    newRowContentUnResolved = newRowContentUnResolved +
                        `   <tr id = "` + IDPetition[key] + "_" + Status[key] + `" onclick="acceptModal( ` + sendUserRequest + `)">
                            <td class="text-center">
                                <h7 class="no-margin"> ` + PetitionDate[key] + ` <small class="display-block text-size-small no-margin"></small></h7>
                                <h6 class="no-margin">
                            </td>
                            <td>`;
                    if (Status[key] == "Pending") {
                        counterUnResolved = counterUnResolved + 1;
                        newRowContentUnResolved = newRowContentUnResolved + `
                        <div class="media-left media-middle">
                            <a href="#" class="button">
                                <i class="icon-circle2" style="color:#EE8A32"></i>
                            </a>
                        </div>
                        <div class="media-body">
                            <a href="#" class="display-inline-block text-default text-semibold letter-icon-title"> User Petition</a>
                            <div class="text-muted text-size-small"><h7 style="color:#EE8A32; font-weight:600">` + Status[key] + ` </h7></div>
                        </div>                      
                        `;
                    }
                    else
                    {
                        counterConfirmed = counterConfirmed + 1;
                        newRowContentUnResolved = newRowContentUnResolved + `
                        <div class="media-left media-middle">
                            <a href="#" class="button">
                                <i class="icon-circle2" style="color:#57A7C8"></i> 
                            </a>
                        </div>
                        <div class="media-body">
                            <a href="#" class="display-inline-block text-default text-semibold letter-icon-title"> User Petition</a>
                            <div class="text-muted text-size-small"><h7 style="color:#57A7C8; font-weight:600">` + Status[key] + ` </h7></div>
                        </div>                      
                        `;
                    }
                    newRowContentUnResolved = newRowContentUnResolved + `
                            </td>
                            <td>
                                <a href="#" class="text-default display-inline-block">
                                    <span class="text-semibold">[#` + IDPetition[key] + `] User addition requested for ` + Username[key] + `</span>
                                    <span class="display-block text-muted">` + Description[key] + `</span>
                                </a>
                            </td>
                            <td>
                                <a href="#" class="text-default display-inline-block">
                                    <span class="text-semibold"> Privilege: </span> <span>` + Privilege[key] + `</span><span class="text-semibold"> Email: </span> <span>` + Email[key] + ` </span> <span class="text-semibold">Domain: </span><span>` + Domain[key] + ` </span>
                                </a>
                            </td>`;
                    if (Status[key] == "Pending") {
                        newRowContentUnResolved = newRowContentUnResolved + `
                            <td class="text-center">
                                <ul class="icons-list">
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-menu7"></i></a>
                                        <ul class="dropdown-menu dropdown-menu-right">
                                            <li id="petition_accept" ` + IDPetition[key] + ` onclick="acceptModal(` + IDPetition[key] + ` )"><a href="#"><i class="icon-checkmark3 text-success"></i> Accept Petition</a></li>
                                            <li><a href="#"><i class="icon-cross2 text-danger"></i> Decline Petition</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </td>
                        </tr>`;
                    }
                    else {
                        newRowContentUnResolved = newRowContentUnResolved + `
                            <td class="text-center">
                                <ul class="icons-list">
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-menu7"></i></a>
                                        <ul class="dropdown-menu dropdown-menu-right">
                                            <li><a href="#"><i class="icon-pencil4"></i> Add Comments</a></li>
                                            <li><a href="#"><i class="icon-history"></i> Rollback Request</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </td>
                        </tr>`;
                    }
                }               
            });

            counterResolved = Status.length - counterUnResolved - counterConfirmed;

            newRowContent = `<tr class="active border-double">
                                <td colspan="4"><h7 style="font-weight:500">Active tickets</h7></td>
                                <td class="text-right">
                                    <span class="badge bg-orange">` + counterUnResolved + `</span>
                                    <span class="badge bg-blue">` + counterConfirmed + `</span>
                                </td>
                             </tr>`;

            newRowContentResolved =
                `<tr class="active border-double">
                <td colspan="4"><h7 style="font-weight:500">Resolved tickets</h7></td>
                <td class="text-right">
                    <span class="badge bg-success">` + counterResolved + `</span>
                </td>
                </tr>`;

            $.each(Privilege, function (key, value) {
                if (Status[key] == "Inserted") {        
                    newRowContentResolved = newRowContentResolved +
                        `   <tr>
                            <td class="text-center">
                                <h7 class="no-margin"> ` + PetitionDate[key] + ` <small class="display-block text-size-small no-margin"></small></h7>
                                <h6 class="no-margin">
                            </td>
                            <td>
                                <div class="media-left media-middle">
                                    <a href="#" class="button">
                                        <i class="icon-circle2" style="color:#87C857"></i>
                                    </a>
                                </div>

                                <div class="media-body">
                                    <a href="#" class="display-inline-block text-default text-semibold letter-icon-title"> User Petition</a>
                                    <div class="text-muted text-size-small"><h7 style="color:#87C857; font-weight:600">` + Status[key] + ` </h7></div>
                                </div>
                            </td>
                            <td>
                                <a href="#" class="text-default display-inline-block">
                                    <span class="text-semibold">[#` + IDPetition[key] + `] User addition requested for ` + Username[key] + `</span>
                                    <span class="display-block text-muted">` + Description[key] + `</span>
                                </a>
                            </td>
                            <td>
                                <a href="#" class="text-default display-inline-block">
                                    <span class="text-semibold"> Privilege: </span> <span>` + Privilege[key] + `</span><span class="text-semibold"> Email: </span> <span>` + Email[key] + ` </span> <span class="text-semibold">Domain: </span><span>` + Domain[key] + ` </span>
                                </a>
                            </td>
                            <td class="text-center">
                                <ul class="icons-list">
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-menu7"></i></a>
                                        <ul class="dropdown-menu dropdown-menu-right">
                                            <li><a href="#"><i class="icon-pencil4"></i> Add Comments</a></li>
                                            <li><a href="#"><i class="icon-cancel-square" style="color:red"></i> Delete Request</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </td>
                        </tr>`;
                }
            });

            $("#activeTickets tbody").html(newRowContent + newRowContentUnResolved + newRowContentResolved);
        }
    });
    
});
function acceptModal(receivedValue) {
    debugger;
    var newRowContent;

    //test = sendUserRequest[0];
    //test2 = sendUserRequest[1];

    newRowContent = `<div class="form-group row" style="margin-bottom: 10px;">
                        <label class="col-md-4 col-form-label">Plant Reference</label>
                        <div class="col-md-8">
                            <input id="#" name="#" type="text" placeholder="Automatic Web App" class="form-control" disabled />
                        </div>
                    </div>`;
    $("#modalForSpecificPetition").html(newRowContent);

    $('#modal_user').modal('toggle');
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div class="row">
                            <div class="col-lg-12">
                                <div class="col-lg-12-offset-2">
                                <!-- Support tickets -->
                                <div class="tab-content">
                                <div class="tab-pane pushbar_main_content" id="requestsUserAdmin">
                                <div class="panel panel-flat">
                                    <div class="panel-heading">
                                        <h5 class="panel-title" style="font-weight:500">USER REQUESTS</h5>
                                        <div class="heading-elements">
                                            <button type="button" class="btn btn-link daterange-ranges heading-btn text-semibold">
                                                <i class="icon-calendar3 position-left"></i> <span></span> <b class="caret"></b>
                                            </button>
                                        </div>
                                    </div>
                                    <div class="table-responsive">
                                        <table class="table text-nowrap" id="activeTickets">
                                            <thead>
                                                <tr>
                                                    <th style="width: 50px; font-size:14px">Due</th>
                                                    <th style="width: 300px;font-size:14px">Type</th>
                                                    <th style="font-size:14px">Description</th>
                                                    <th style="font-size:14px">Petition Information</th>
                                                    <th class="text-center" style="width: 20px;font-size:14px"><i class="icon-arrow-down12"></i></th>
                                                </tr>
                                            </thead>
                                            <tbody>

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                </div>
                                </div>
                                <!-- /support tickets -->

                            </div>
                            </div>
                        </div>

Note that the code for the function is not finished yet because first I want to solve the variable issue.

I tried firstly to pass 1 value or variable, it worked without any issue. Then I tried to send multiple variables and then started failing. Trying to fix it I made an array so send only 1 value but the same error persisted. Other thing I tried and is the one that now appears in the code is to parse the special characters to ASCII values but nothing but the same error happened.