SyntaxError: missing ) after argument list when parsing a function string that contains another function as a param

I am passing a javascript function from aspx side to execute in the page where one parameter is a function, page contains complex logic and at some point it tries to parse the callback that is a string agin to a function that causes the following error.

C# code:

 string urlVal = $"javascript:(CallMyFunc("{param1}", "{HttpUtility.JavaScriptStringEncode(onclickHandler)}"))";

onclick handler here is a string that is another function with params

onclickHandler = "CallMyCloseFunc('val1', 'val2')"

Now when the next set of code tries to parse this to a function, this is what happens

new Function("CallMyFunc('FirstVal', 'CallMyCloseFunc('val1','val2')');")

gives the error

SyntaxError: missing ) after argument list
at new Function ()
at eval

How can we get this working?

How can I ensure any drawing is done on top of any html elements?

I am trying to create a pop up over some images when the images are selected by clicking (and launch is then clicked.) I have used .createImg() to make the selectable images (the planets), as they allow for easy click detection through .mousePressed(). However, because they are html elements, they are on top of the canvas. I can’t really find anything online. Is it possible to somehow make all further drawings on top of these images?

Relevant Code:

mercury = createImg("images/mercury.png")

Image creation (.size() and .position() are used on each.)

class planet {
  createPlanet(imgPlanet, rx, ry){
    imgPlanet.size(rx,ry);
    imgPlanet.position(this.x - (imgPlanet.width/2), this.y - (imgPlanet.height/2)) 
  }
}

Planet image is initialized. This is in a class and separate file, called by:

mercuryPlanet = new planet(200, 720 / 2, "#88715B", false, mercury, (720 / 19))
mercuryPlanet.createPlanet(mercury, 28,28);

in the main file (1st line in setup(), second in draw())

Is it possible to draw over these (without redoing all work thus far) in the main draw() function at all? Or in some other way if it’s possible.

Full sketch:
https://editor.p5js.org/pseudonymonym/sketches/Ly-9yaVh8

Is it possible to create a browser extension that enables webcam tracking in Google Meet?

I’m making chrome extension for coursework, who tracking users in google meet. Can I create a enable to do webcam tracking? Who turned on camera, how long camera was turned on etc.

I was looking for some class who responsibility for webcam, but for this class, can’t find who turned on camera. And I found piece of class “S7urwe” who responsibility for camera, but i can’t know who is it

How can I get the menu divisions to work on my ASP.NET toponymy website?

I’m making a toponymy website in asp.net and I’ve gotten most of it done, but I need help getting the menu divisions to work, can anyone tell me how I can get the divisions to work?

So i do this code:

<div class="modal fade" id="modalRegisterForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
  <div class="modal-content" style="background-color: rgb(255, 255, 255);">
    <div class="modal-header text-center">
      <h4 class="modal-title w-100 font-weight-bold">Login</h4>
      <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    <div class="modal-body mx-3">
      <div class="md-form mb-5">
        <i class="fas fa-user prefix grey-text"></i>
        <label data-error="wrong" data-success="right" for="orangeForm-name">Nome</label>
        <input type="text" id="orangeForm-name" class="form-control validate">
      </div>
      <div class="md-form mb-5">
        <i class="fas fa-envelope prefix grey-text"></i>
        <label data-error="wrong" data-success="right" for="orangeForm-email">E-mail</label>
        <input type="email" id="orangeForm-email" class="form-control validate">
      </div>

      <div class="md-form mb-4">
        <i class="fas fa-lock prefix grey-text"></i>
        <label data-error="wrong" data-success="right" for="orangeForm-pass">Palavra-Pass</label>
        <input type="password" id="orangeForm-pass" class="form-control validate">
      </div>

    </div>
    <div class="modal-footer d-flex justify-content-center">
      <button class="btn btn-danger">Entrar</button>
    </div>
  </div>
</div>
  <ul class="nav navbar-nav">
      <li>
      <a class="navbar-brand" href="#">Pesquisa e Listagem</a>
      <a class="navbar-brand" href="#">Gestão</a>
      <a class="navbar-brand" href="#">Gerir Utilizadores</a>
    </li>
  </ul>

How to delete authentication token when logging out with react native?

I am using django rest framework and react native for the front-end. I am trying to delete the authentication token when a user is logging out in the front-end. But apparently the token stil exist when the logout function is triggered. Because the token still exists in the django admin panel.

So for the logout I have this service:

export const logoutRequest = async () => {
    try {
        const response = await fetch("http://192.168.1.65:8000/api/user/logout/");
        await removeToken();
        return await response.json();
    } catch (error) {
        console.log(error);
        throw error;
    }
};

and removeToken:

export const removeToken = async () => {
    try {
        await AsyncStorage.removeItem("Token");
    } catch (error) {
        console.log("Renove authentication token failed :", error?.message);
    }
};

So when a user logs in I see that a token is created in the django admin panel. But when a user logs out in the front-end I don’t see in the django admin panel that the token has been removed. But the api call for the logout works. I tested this in swagger. The token has been removed in the django admin panel.

Question: how to remove the authentication token with react native?

Vue JS – Data is undefined between dev and prod

this is my component. I get project raws from API, then i loop to create an array with months from project release date. On my template, i get months from my data. It works fine on dev but when i build my project my data months is undefined. I don’t understand why ?

<template>
  <div class="container">
    <div class="row">
      <div class="offset-2 col-8 my-5">
        <h1>Releases</h1>
      </div>
      <div v-if="this.months.length > 0" id="projects" class="offset-2 col-8">
        <div v-for="(month, index) in projects" :key="index" class="mb-5">
          <h3 class="mb-5">{{ this.months[index] }}</h3>
          <div v-for="project in month" :key="project.id" class="project mb-3">
            <p>{{ project.name }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import moment from "moment";

export default {
  name: "List",
  data: () => {
    return {
      projects: [],
      months: [],
      range: {
        start: null,
        end: null,
      },
    };
  },
  beforeMount() {
    this.range.start = new Date();
    const date_end = new Date();
    date_end.setFullYear(date_end.getFullYear() + 3);
    this.range.end = date_end;
    this.getProjectsByRange();
  },
  methods: {
    async getProjectsByRange() {
      const formData = new FormData();
      formData.append("range", JSON.stringify(this.range));

      const datas = await this.axios
        .post("/projects/range", formData)
        .then((response) => {
          return response.data.projects;
        });

      datas.forEach((project) => {
        const month = moment(project.release_date).format("MMMM YYYY");
        if (!this.months.includes(month)) {
          this.months.push(month);
          this.projects[this.months.indexOf(month)] = [];
        }
        this.projects[this.months.indexOf(month)].push(project);
      });
    },
  },
};
</script>

JavaScript minesweeper game guidance

I’m learning about JavaScript and for homework we have to create a minesweeper game using only JavaScript and be able to play it in the VS code terminal, after a lot of help, research, and crying, I have managed to create this function, the function takes one argument and prints a grid of that size (i.e. 3 = 3×3 and so on), when I use console.table, the result is a table with three columns and three rows (picture attached), I have assigned an object to each array item, the object consists of { state: ‘unopened’, mineOrNo: ‘false’}, I am not 100% sure the function is even correct, we were also told about using readline, if anyone can guide me on the next steps or if you have any tips, that’ll be great, thanks. image of the function output (I hope this was a good description and not crappy)

function initialiseGameBoard(size) { 
    let arr = []
    for (let i = 0; i < size; i++) { 
        arr[i] = []
        for (let a = 0; a < size; a++) { 
            let cell = {
                state: "unopened", // open | flag?
                mineOrNo: Math.random() < 0.5 // true | false 
            }
            arr[i][a] = cell;
            if (cell.state == 'unopened') {
                arr[i][a] = [];
            }
        }
    }
    console.table(arr)
}

Rendering element multiple times on button Click

I want to render a div component as many times a button is clicked in React JS, what should I use?

The task here was to add multiple input fields when i click the plus button, also can we use for loop here, to render elements ?
This is the component I want to render multiple times on button click event:

import React from 'react'
import {Container,Col,Row,Table,Form,FormGroup,Label,Input} from 'reactstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
export default function AddRemoveInputField(prop) {

    
  return (
    <div className='smallHr'>
        <div className="space"></div>
        <div><hr style={{width:
        '9rem',margin:'auto'}}/></div>
        <div className="space"></div>
        <FormGroup row>
                    <Label
                      for="exampleText"
                      sm={2} className='bold padding' 
                    >
                      Title
                    </Label>
                    <Col sm={10}>
                      <Input onChange={prop.action}
                        id="exampleText"
                        name="title"
                        type="text"
                      />
                    </Col>
                  </FormGroup>

      <FormGroup row>
                    <Label
                      for="exampleText"
                      sm={2} className='bold padding' 
                    >
                      URL
                    </Label>
                    <Col sm={10}>
                      <Input onChange={prop.action}
                        id="exampleText"
                        name="url"
                        type="text"
                      />
                    </Col>
                  </FormGroup>
                  <div className="space"></div>
                  <FormGroup row>
                  <Label 
                      for="exampleText"
                      sm={2} className='bold padding'
                    >
                      Discription
                    </Label>
                    <Col sm={10}>
                      <Input
                        id="exampleText"
                        name="discription"
                        type="textarea" onChange={prop.action}
                      />
                    </Col>
                  </FormGroup>
                  <div className="space"></div>
                  <FormGroup row>
                    <Label className='bold padding'
                      for="exampleText"
                      sm={2}
                    >
                      Source
                    </Label>
                    <Col sm={10}>
                      <Input onChange={prop.action}
                        id="exampleText"
                        name="source"
                        type="text"
                      />
                    </Col>
                  </FormGroup>
    </div>
  )
}```


The Component Looks Like This:

[enter image description here](https://i.stack.imgur.com/XnNmr.png)

I tried using for loop in the Component, but it only rendered it once.


I tried using for loop in the Component, but it only rendered it once.

How to implement GitHub Copilot-like code suggestions in JetBrains IDE plugin

everyone!

Can someone guide me on how to make the same implementation of code suggestion as in GitHub Copilot (very interested in implementation in JetBrains in particular). Tried everything, googling gave nothing, unfortunately.

Now I just insert the code into the editor via document.insertString

I will be glad to get any ideas and comments

I’m trying to implement the same suggestion mechanism as the GitHub Copilot, but I have no ideas.

Place Bootstrap Datepicker on Bootstrap Modal

I am displaying below HTML as initial content.

<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        //more code here
      </div>
      <div>
        <div class="tplan">
          //more code here
        </div>
        <div></div>
        <div class="tplan">
          //more code here
        </div>
      </div>
    </div>
  </div>
</div>

Below HTML is my second screen on modal.

<div class="tab modal-content">
    <div>
        <div class="form-row">                
            <div class="form-group col-md-3">
                <label for="plan_start">Plan Start</label>
                <input type="text" class="form-control" name="plan_start" id="datepicker">
            </div>
        </div>
    </div>
</div>

I am using below jQuery code to show bootstrap modal. I would like to show bootstrap datepicker on bootstrap modal. But this is not working.

        $(document).ready(function(){
            var modalContent = $('.modal-content').eq(0).html();

            $("#plan_templates").click(function() {
                $('.modal').find('.modal-content').html(modalContent);                
                $(".modal").modal("show");


                $(".tplan").click(function() {
                    var index = $(".tplan").index(this);
                    $('.modal').find('.modal-content').html($('.tab').eq(index).html());

                    $('.modal').on('shown.bs.modal', function(e) {
                        $('#datepicker').datepicker({
                            format: "mm/yyyy",
                            startView: "year", 
                            minViewMode: "months"
                        });
                    });
                });
            });
        });

how custom output cache by user

After referencing this site text. I wanted to know the idea of giving users the ability to custom output cache that this site did.
I just wanted to have an idea about this.
Hope you guys can give me any ideas . thanks a lot

Is it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server [closed]

Is it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online server
Is it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online server
Is it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online server
Is it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is
Is it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverlost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online serverIs it possible to save form locally if the connection is lost? using html javascript php .. when reconnected then send the data to the server?

save data locally afer send to the online server

Firebase Timestamp format to javascript [duplicate]

I have converted a string into a date format in my firebase firestore database.
The date is stored as a timestamp and appears in the table as 11 December 2022 00:00:00. This seems to be correct as when I edit the date in firestore it gives the same result. In javascript I use ‘new Date (data.date *1000).toDateString()’ – the date displays as ’11 December 3991′. The data.date displays as ‘Timestamp(seconds=1645747200, nanoseconds=0)’.

Any help appreciated

I have tried everything online with no success.