How can i solve a touch event bug in my mobile game

I’m building a match 3 game for mobile with ionic/angular.
For that i studied how touch gestures work.

I have a problem i’m trying to solve since a few days ago without success.

If i swipe move a tile to the left or to the right i can only move it across one tile.

If i move one tile up or down i can move it over as many tiles as i want.

I need to be able to move a tile left or right across as many tiles as i want.

Each tile has a with of 50px, therefore the sensitivity is equal to 50.

One strange thing i noticed and i’m not able to solve is that the onTouchEnd only fires if i swipe up or down. That maybe one of the causes of the problem because this.selectedTile = null does not happens and the touchmove does not have a new reference to swipe across path with more than 2 tiles.

I attached the relevant code and a picture of the game board.

Can somebody help me?

LOGIC (creating game board, touch gestures):

generateGameBoard(): void {
        this.startTimer();
        const rows = 6;
        const cols = 6;
        const board: Cell[][] = [];

    // Calculate the total number of tiles needed for pairs of 3
    const totalPairsOf3 = Math.floor((rows * cols) / 3);
    let generatedPairsOf3 = 0;

    // Shuffle the Egyptian hieroglyphs array to ensure randomness
    const shuffledHieroglyphs = this.shuffleArray(this.symbols);

    for (let i = 0; i < rows; i++) {
      const row: Cell[] = [];
      for (let j = 0; j < cols; j++) {
        // Check if we have generated enough pairs of 3
        if (generatedPairsOf3 < totalPairsOf3) {
          // Generate pairs of 3
          const pairIndex = generatedPairsOf3 % shuffledHieroglyphs.length;
          const pairHieroglyph = shuffledHieroglyphs[pairIndex];
          row.push({
            symbol: pairHieroglyph?.symbol,
            color: pairHieroglyph?.color,
          });
          generatedPairsOf3++;
        } else {
          // Fill the remaining tiles with random tiles
          const randomIndex = Math.floor(Math.random() * this.symbols.length);
          const randomHieroglyph = this.symbols[randomIndex];
          row.push({
            symbol: randomHieroglyph?.symbol,
            color: randomHieroglyph?.color,
          });
        }
      }
      board.push(row);
    }

    this.gameBoard = board;
    this.checkAdjacentTiles();
  }


shuffleArray(array: any[]): any[] {
    for (let i = array.length - 1; i > 0; i--) {
      const j = Math.floor(Math.random() * (i + 1));
      [array[i], array[j]] = [array[j], array[i]];
    }
    return array;
  }

onTouchStart(event: TouchEvent) {
    event.preventDefault();

    const touchedElement = event.touches[0].target as HTMLElement;
    if (!touchedElement || !touchedElement.dataset) return;

    const touchedRow = parseInt(touchedElement.dataset['row'] || '0', 10);
    const touchedCol = parseInt(touchedElement.dataset['col'] || '0', 10);

    console.log('Touched row:', touchedRow, 'Touched col:', touchedCol);

    this.selectedTile = { row: touchedRow, col: touchedCol };
    this.startX = event.touches[0].clientX;
    this.startY = event.touches[0].clientY;
  }


onTouchMove(event: TouchEvent) {
    event.preventDefault();

    if (!this.selectedTile) return;

    const currentX = event.touches[0].clientX;
    const currentY = event.touches[0].clientY;

    const deltaX = currentX - this.startX;
    const deltaY = currentY - this.startY;

    const sensitivity = 50;

    // Check if movement is primarily horizontal or vertical

    const absDeltaX = Math.abs(deltaX);
    const absDeltaY = Math.abs(deltaY);

    const numTilesToMoveX = Math.floor(absDeltaX / 50);
    const numTilesToMoveY = Math.floor(absDeltaY / 50);

    let newRow = this.selectedTile.row;
    let newCol = this.selectedTile.col;

    if (Math.abs(deltaX) > Math.abs(deltaY)) {
      // Horizontal movement
      if (deltaX > sensitivity) {
        // Swipe right
        console.log('Swiped right');
        newRow += numTilesToMoveX;
      } else if (deltaX < -sensitivity) {
        // Swipe left
        console.log('Swiped left');
        newRow -= numTilesToMoveX;
      }
    } else {
      // Vertical movement
      if (deltaY > sensitivity) {
        // Swipe down
        console.log('Swiped down');
        newCol += numTilesToMoveY;
      } else if (deltaY < -sensitivity) {
        // Swipe up
        console.log('Swiped up');
        newCol -= numTilesToMoveY;
      }
    }

    newRow = Math.max(0, Math.min(newRow, this.gameBoard[0].length - 1));
    newCol = Math.max(0, Math.min(newCol, this.gameBoard[0].length - 1));

    if (newRow !== this.selectedTile.row || newCol !== this.selectedTile.col) {
      // Swap the tiles
      [
        this.gameBoard[newRow][newCol],
        this.gameBoard[this.selectedTile.row][this.selectedTile.col],
      ] = [
        this.gameBoard[this.selectedTile.row][this.selectedTile.col],
        this.gameBoard[newRow][newCol],
      ];

      // Update the selected tile's position
      this.selectedTile.row = newRow;
      this.selectedTile.col = newCol;

      // Update the start position for the next calculation
      this.startX = currentX;
      this.startY = currentY;
    }
  }

  onTouchCancel(event: TouchEvent) {
    this.onTouchEnd(event);
  }

  onTouchEnd(event: TouchEvent) {
    console.log('touchend');
    this.soundService.playSfx();
    this.checkAdjacentTiles();
    event.preventDefault();
    this.selectedTile = null;
  }

MARKUP:

  <div
    class="game-board"
    (touchstart)="onTouchStart($event)"
    (touchmove)="onTouchMove($event)"
    (touchcancel)="onTouchCancel($event)"
    (touchend)="onTouchEnd($event)"
  >
    <div class="row" *ngFor="let row of gameBoard; let i = index">
      <div
        class="cell"
        *ngFor="let cell of row; let j = index"
        [attr.data-row]="i"
        [attr.data-col]="j"
        [style.color]="cell.color"
        [class.glow]="cell.glow"
      >
        {{ cell.symbol }}
      </div>
    </div>
  </div>

enter image description here

Office Javascript API is failing on call to OfficeExtension.Promise

We have developed an Outlook add-in that uses the Office Javascript API to access several properties of calendar items. We are following the recommendations and examples from MS, like exposed in the following article in section “Wrap common APIs in Promise-returning functions”: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/asynchronous-programming-in-office-add-ins

The thing is that the plugin has been working for a few months now until a few days ago, when we started receiving error reports from our clients.

The reported error is in the call to OfficeExtension.Promise, as per the following code:

return new OfficeExtension.Promise(function (resolve, reject) {
    try { 
        Office.context.mailbox.item.requiredAttendees.getAsync(function (asyncResult) { 
            // Put whatever here
        });
    }

which returns error: “46032ae441eb1f82ea83.js:703 Uncaught (in promise) TypeError: OfficeExtension.Promise is not a constructor”.

We found that the falling library has the following header:
Outlook Web specific API library osfweb version: 16.0.17313.15000 office-js-api version: 20240118.8

The error happens in office web browser clients but also in Windows Outlook clients, but it does not affect all clients or users.

It seems obvious that MS has made some changes in their library. We opened the question in some of their forums but we got no answer. We even opened a ticket on a paid subscription and their only response was ¨Your subscription accesses your complementary support which doesn’t cover Microsoft 365 developer issues¨.

Did anyone experience the same issue? Did you find a solution?

handleOpenChange triggering before onSubmit

I’m using shadcn/ui’s Dialog component and Form component, which uses react-form-hook.

const form = useForm<z.infer<typeof formSchema>>({
  resolver: zodResolver(formSchema),
  defaultValues: {
    name: 'Figma',
    category: 'Software',
    version: '1.0',
    location: 'Taipei',
    status: 'Available',
  },
});

const onSubmit = (values: z.infer<typeof formSchema>) => {
  const newItems = {
    ...values,
  };

  setItems((prevItems) => [...prevItems, newItems]);
};

const handleOpenChange = (open) => {
  setIsOpen(open);

  if (!open) {
    form.reset()
  }
};

return (
  <Dialog open={isOpen} onOpenChange={handleOpenChange}>
    <DialogContent>
      <Form {...form}>
        <form onSubmit={form.handleSubmit(onSubmit)}>
          <input type="text" {...form.register("exampleFieldName")} />
          <DialogClose asChild>
            <Button type="submit">Submit</Button>
          </DialogClose>
          <DialogClose asChild>
            <Button type="button" variant="secondary">
              Close
            </Button>
          </DialogClose>
        </form>
      </Form>
    </DialogContent>
  </Dialog>
)

The issue here is that handleOpenChange always triggers before onSubmit (whether I click the Submit or Close button. This means the form will reset before submitting.

Is this how the Dialog onOpenChange and the form onSubmit are supposed to behave together? If so, how to solve this issue?

XSS attack on location map

I’m working in Drupal and I have a page with an input field to search for your location. Now, it’s possible to do a XSS attack and I’m trying to fix it with a sanitizer function, but it does not seem to do anything and I don’t understand why. Can any of you review the code and help me out? It’s for my internship and it would be great if I can fix this problem. This is my code atm, and I get a console of this: Sanitized input: alert(&quot;XSS attack!&quot;);. It looks like it works, but I still get an alert in my browser if I put this in the input field: <script>alert("XSS attack!");</script>

        if (typeof input !== 'string') {
          return '';
        }

        // Remove any HTML tags and attributes using a regular expression
        var sanitizedInput = input.replace(/<[^>]*>?/gm, '');

        // Escape HTML entities
        sanitizedInput = sanitizedInput.replace(/[&<>"']/g, function(match) {
          return {
            '&': '&amp;',
            '<': '&lt;',
            '>': '&gt;',
            '"': '&quot;',
            "'": '&#39;'
          }[match];
        });

        return sanitizedInput;
      }
      
      function onPlaceChanged() {
        var place = autocomplete.getPlace();
        var input = document.getElementById('autocomplete').value;

        if (place === undefined || input === '') {
          return;
        }

        // Sanitize input to prevent XSS attacks
        var sanitizedInput = sanitizeInput(input);
        console.log('Sanitized input:', sanitizedInput);

        if (place !== undefined && place.geometry) {

          var coordinates = {
            lat: place.geometry.location.lat(),
            lng: place.geometry.location.lng()
          };

          findClosestOffice(coordinates);
        } else {
          var locationName;
          if (place !== undefined) {
            locationName = place.name;
          } else {
            locationName = input;
          }

          var geocoder = new google.maps.Geocoder();
          geocoder.geocode({
            componentRestrictions: countryRestrict,
            'address': locationName
          }, function (results, status) {
            if (status === 'OK') {
              var coordinates = {
                lat: results[0].geometry.location.lat(),
                lng: results[0].geometry.location.lng()
              };
              findClosestOffice(coordinates);
            }
          });
        }

        dataLayer.push({
          'event': 'officeSearch',
          'searchTerm': input
        });

        if (input){
          var location = input.split(', ');
          if(offices_tags.hasClass('d-none')) {
            offices_tags.removeClass('d-none');
          }
          offices_tag_label.html(location[0]);
        } else {
          offices_tag_label.html('');
        }

        return;
      } 

Why my next auth and middleware config still make user go to login page after user has logged in?

Why after I logged in it still can go to the /api/auth/signin which is my login page?
It’s like my middleware doesnt trigger on my login page?
Also please check whether this is the right way to create next auth and middleware config?

this is my api/auth/[…nextauth]/route.ts

const handler = NextAuth({
  session: {
    strategy: "jwt",
  },
  providers: [
    CredentialsProvider({
      name: "Sign in",
      type: "credentials",
      credentials: {
        username: { label: "Username", type: "text" },
        password: { label: "Password", type: "password" },
      },
      async authorize(credentials) {
        const { username, password } = credentials as Credentials;

        const { data } = await api.post("/cms/auth/login", {
          username,
          password,
        });

        const user = {
          id: Math.random().toString(),
          role: data.data.role,
          token: data.data.token,
        };

        return user;
      },
    }),
  ],
  callbacks: {
    async session({ session, token }: { session: any; token: any }) {
      session.user = token.user;
      return session;
    },
    async jwt({ token, user }) {
      if (user) {
        token.user = user;
      }
      return token;
    },
  },
  secret: process.env.NEXTAUTH_SECRET,
});

export { handler as GET, handler as POST };

this is my ./middleware.ts

export default withAuth(
  async function middleware(request) {
    const { token } = request.nextauth;
    console.log('on middleware')

    if (!token) {
      return NextResponse.redirect(new URL("/login", request.url));
    }

    const { user } = token;

    if (user.role === "PARTNER") {
      if (request.url.includes("/cms/admin") || request.url.includes("/api/auth")) {
        return NextResponse.redirect(
          new URL("/cms/partner/dashboard", request.url),
        );
      }
    } else if (user.role === "ADMIN") {
      if (
        request.url.includes("/cms/partner") ||
        request.url.includes("/auth")
      ) {
        return NextResponse.redirect(
          new URL("/cms/admin/dashboard", request.url),
        );
      }
    }
  },
  {
    secret: process.env.NEXTAUTH_SECRET,
  }
);

After I logged in, user still can go to login page (/api/auth/signin).
It’s like my middleware doesnt trigger on login page

How to use CSS style to add title for div instead of using h2 tag?

I working group of div inside table my issue that i can’t add group text

title header instead of using h2 tag .

so i need to remove h2 tag and use it as header title for div as class header on image below .

How to do it ?

my code script as below

<div style="display: flex;">
      <table style="border:1px solid black">
          <tr>
              <td style="width:300px;height:200px;border:1px solid black">
                  <div id="classesContainer" >
                  
                      <h2>Classes</h2> 
                      <div id="classesList" class="scrollable-list" style="padding-left:5px;padding-top:5px; margin-top:10px;margin-left:10px;width:250px;height:200px;border:1px solid black;">
                      </div>
                  </div>
              </td>
              <td style="width:250px;height:200px;border:1px solid black">
                  <div id="subClassesContainer" style="margin-left:15px;">
                      <h2>Subclasses</h2>
                      <div id="subClassesList" class="scrollable-list" style="padding-left:5px;padding-top:5px; margin-top:10px;margin-left:10px;width:200px;height:200px;border:1px solid black;">
                      </div>
                  </div>
              </td>
              <td style="width:250px;height:200px;border:1px solid black">
                  <div id="MakeClassesContainer" style="margin-left:15px;">
                      <h2>Make</h2>
                      <div id="MakeClassesList" class="scrollable-list" style="padding-left:5px;padding-top:5px; margin-top:10px;margin-left:10px;width:200px;height:200px;border:1px solid black;">
                      </div>
                  </div>
              </td>
              <td style="width:250px;height:200px;border:1px solid black">
                  <div id="DescriptionClassesContainer" style="margin-left:15px;">
                      <h2>Description</h2>
                      <div id="DescriptionClassesList" class="scrollable-list" style="padding-left:5px;padding-top:5px; margin-top:10px;margin-left:10px;width:200px;height:200px;border:1px solid black;">
                      </div>


                  </div>
              </td>
              <td style="width:250px;height:200px;border:1px solid black">
                  <div id="DetailsClassesContainer" style="margin-left:15px;">
                      <h2>Details</h2>
                      <div id="DetailsClassesList" class="scrollable-list" style="padding-left:5px;padding-top:5px; margin-top:10px;margin-left:10px;width:250px;height:200px;border:1px solid black;">
                      </div>


                  </div>
              </td>
          </tr>
      </table>

  </div>

so i need to add title for div classesContainer and DescriptionClassesContainer and MakeClassesContainer and subClassesContainer .

desired result will be as below image

red title marker as i need

so Exactly I need to display h2 as title instead using h2 tag

for more details i fill div with below jquery

$('#btnDisplay').click(function (event) {
     event.preventDefault();
     var dropdown = $('#accountclassname-select');
     dropdown.empty();
   
     $.ajax({
         url: '?handler=AccountClassName',
         type: "GET",
         dataType: "json",
         success: function (response) {
             $('#classesContainer').show();
             $('#classesList').html(''); // Clear existing classes
             $('#classesList').append('<input type="checkbox" class="classCheckbox" value="0" /> All <br />');
             $.each(response, function (i, classes) {
                 $('#classesList').append('<input type="checkbox" class="classCheckbox" value="' + classes.classAccountId + '" /> ' + classes.classAccountName + '<br />');
             });
       
         }
     });
 });

what i have tried

CSS style

.group-title {
     font-size: 18px;
     font-weight: bold;
     margin-right: 10px;
     width: 100px;
 }


<div id="classesContainer">
 <div class="group-title"> 
Classes
</div>
    
     <div id="classesList" class="scrollable-list" style="padding-left:5px;padding-top:5px; margin-top:10px;margin-left:10px;width:250px;height:200px;border:1px solid black;">
     </div>
 </div>

Sum up two kind of values in nested Object by category1

It would be highly appreciated if you could help me out regarding nested JavaScript object. I would like to create a new object by summing up two values, price and quantity, by category in the nested object, “objToBeSumUp”. It is so hard to sum up two values at the same time, at least I can create the for loop to sum up one value as mentioned in My halfway code below though.

Also, we would like to sort the object by total price in descending order.

Object to be sum up:

const objToBeSumUp ={
    0: {
        value: {
            category:{
                value: a
            },
            price:{
                value: 500
            },
            quantity:{
                value: 5
            }
        }
    },
    1: {
        value: {
            category:{
                value: a
            },
            price:{
                value: 300
            },
            quantity:{
                value: 3
            }
        }
    },
    2: {
        value: {
            category:{
                value: b
            },
            price:{
                value: 800
            },
            quantity:{
                value: 8
            }
        }
    },
    3: {
        value: {
            category:{
                value: b
            },
            price:{
                value: 400
            },
            quantity:{
                value: 4
            }
        }
    }
}

Expected Object:

const objExpected = {
    0: {
        value: {
            category:{
                value: b
            },
            totalPrice:{
                value: 1200
            },
            totalQuantity:{
                value: 12
            }
        }
    },
    1: {
        value: {
            category:{
                value: a
            },
            totalPrice:{
                value: 800
            },
            totalQuantity:{
                value: 8
            }
        }
    },
};

My halfway code:

const objExpected = {};
for (let i = 0; i < objToBeSumUp.length; i++) {
    const category = objToBeSumUp[i].value['category'].value;
    if (!objExpected[category]) {
      objExpected[category] = 0;
    }
    // Summing prices up
    const price = objToBeSumUp[i].value['price'].value;
    objExpected[category] += parseInt(price)

MetaApi profile issue

I am using MetaApi service to integrate MT5 account. Currently working with MT5 groups.
Here is the API
**https://mt-manager-api-v1.new-york.agiliumtrade.ai/users/current/mt5/provisioning-profiles/{profile_id}/groups
**
When i use Manger API id it gives timeout error and when i use ProvisioningProfile id it give 403 error. Can any one help?

I have given all the information correct like auth-token and profile id still not getting the required output. Any help would be appreciated. Thanks.

How to disable Fullcalendar preventations on events?

I am using Fullcalendar v5.11.5 on my website. I added HTML inputs to events with eventContent function. When I try click to an input element it doesn’t focus. eventInteractive is true but not working as expected. I wonder if there is an exact solution for this situation.

javascript code:

let calendarEl = document.getElementById('calendar');
calendar = new FullCalendar.Calendar(calendarEl, {
    initialView: 'dayGridMonth',
    initialDate: '2024-02-26',
    locale: 'en',
    height: 'auto',
    eventColor: 'transparent',
    eventInteractive: true,
    fixedWeekCount: false,
    eventContent: function(arg) {
        let event = arg.event.extendedProps;
        return {html: getEventHtml(event)};
    },
    eventSources: [
        {
            url: "https://www.example.com/source",
            method: "POST",
        },
    ],
});
calendar.render();

I tried eventClick function to focus input and it worked but not smooth as default input interaction.

eventClick: function(info) {
    info.jsEvent.target.focus();
},

How to create rows for every 3rd item using map?

I am trying to create a grid using map. What i am after is to be able to wrap items into rows of 3. How would i do that?

Here’s my current code:

        this.el = document.getElementById('feed')

        const releases = data.Releases //array of items
        const list = document.createDocumentFragment()

        releases.map(function(release, index) {
          let li = document.createElement('li')

          let a = document.createElement('a')
          let title = document.createElement('h2')
          let date = document.createElement('time')

          title.innerHTML = `${release.Title}`
          date.innerHTML = `${release.PublishDate}`
          a.setAttribute('href', release.EncryptedId)
          
          a.appendChild(date)
          a.appendChild(title)
          li.appendChild(a)
          list.appendChild(li)
        })

        this.el.appendChild(list)

Playwright automated scripting tool detected as a crawler when opening browser web pages, resulting in inability to execute script code

As we continue on the path of anti crawling, we have recently discovered an issue where a webpage opened by Playwright will be detected as an automated script. For example, this website: https://blasterswap.com/9D72 After several days of investigation, I finally identified the problem, but I have not been able to solve it. The browser opened by the automation script will have many startup parameters. Currently, when I look at these websites, I have detected — remote debugging port=0 and — remote debugging pipe. Some people say that extracting and opening the browser before connecting, or changing the webdriver to undefined, have not solved these problems because manually opening the browser also requires adding the — remote debugging port=0 parameter, which cannot be avoided. However, without adding the debug parameter, the script will not execute, but it can pass the detection smoothly. Please ask the deity for a solution, kneel down and beg. It’s been stuck for a week now

Successfully passed the website’s script detection, such as cloudflare detection

Fix Image Size Irrespective of Browser Zoom and Resolution Changes

I need to fix an image size within a div, so it stays the same regardless of browser zoom or resolution changes. Here’s the code:

.non-resizable-watermark {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width:120px;
}
<div class="non-resizable-watermark">
  <img id="watermarkLogoImg" src="https://cdn.sstatic.net/Img/unified/sprites.svg" width="120">
</div>

Here are the problems I’ve faced:

  • Using vw units for the image size makes it responsive to browser width changes, which is not desired.

  • Setting the size in px keeps it constant during browser resizing, but it scales with browser zoom, which I want to avoid.

  • I tried capturing resize events on the window to adjust the image size dynamically, but this didn’t work as expected, likely because zooming doesn’t trigger a resize event in the way I anticipated:

const initialWidth = window.innerWidth;
const defaultWatermarkLogoWidth = 120;

function adjustLogoSize() {
  const currentWidth = window.innerWidth;
  const zoomLevel = currentWidth / initialWidth;
  const scaleFactor = 1 / zoomLevel;
  console.log(scaleFactor);

  document.getElementById('watermarkLogoImg').style.width = defaultWatermarkLogoWidth * scaleFactor + 'px';
}

window.addEventListener('resize', adjustLogoSize);

adjustLogoSize();
.non-resizable-watermark {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width:120px;
}
<div class="non-resizable-watermark">
  <img id="watermarkLogoImg" src="https://cdn.sstatic.net/Img/unified/sprites.svg" width="120">
</div>

The image should remain at a fixed size, not affected by changes in browser zoom level or window resizing. How can this be achieved with CSS or JavaScript, given the standard behaviour of browsers to scale content?

hide dive tag using functionn

function sendValue(s) {

window.returnValue = s;

var value = s.split(‘|’);

var flowId = value[0];

window.opener.setAccValue(s, “flowId”, “credAcc”, “debtAcc”);

//creditDebitRow(flowId);

}

   <TABLE class="picklist_tab" ALIGN=CENTER WIDTH="100%" border="0"

          bordercolor="black" cellpadding=5>

          <caption class='picklist_caption'>Fund List</caption>

          <TR>

                 <TH class="picklist_th">Flow Id</TH>

                 <TH class="picklist_th">Flow Id Name</TH>

                 <TH class="picklist_th">Credit Acc. No.</TH>

                 <TH class="picklist_th">Debit Acc. No.</TH>

                 <%

                       /* String flowId = request.getParameter("param1");

                       flowId = flowId.trim(); */




                       String query = "select flow_id, CR_ACC_NO, DR_ACC_NO, FLOW_ID_NAME from accountmaster ";

                       query += "where active_status = 'Y' and VERIFIED_BY is not null"; // no need of flowId here




                       Statement stmt = con.createStatement();

                       ResultSet rs = stmt.executeQuery(query);




                       while (rs.next()) {

                 %>

         

          <TR>

                 <TD class='picklist_td1' ALIGN="center"><a

                       class='picklist_anchor' target=_self href='#'

                       оnClick="javascript:sendValue('<%=(rs.getString(1))%>|<%=(rs.getString(2))%>|<%=(rs.getString(3))%>')"><%=(rs.getString(1))%></a></TD>

                 <TD class='picklist_td2' ALIGN="left"><%=(rs.getString(4))%></TD>

                 <TD class='picklist_td2' ALIGN="left"><%=(rs.getString(2))%></TD>

                 <TD class='picklist_td2' ALIGN="left"><%=(rs.getString(3))%></TD>

          </TR>

          <%

                 }

          %>

   </TABLE>

   <TABLE align=center width='80%'>




          <TR>

                 <TD align='center'><input type='Button' value='BACK'

                       оnclick='javascript:window.close()' /></TD>

          </TR>




   </TABLE>

   <BR>

=============================================

div id=”creditDebitRow” >

                                                                 <TABLE border="0" cellpadding="2" cellspacing="0"

                                                                 style="WIDTH: 100%;">

                                                                

                                                                 <TR >                                                              

                                                                       <td width="5%">&nbsp;</td>

                                                                       <TD class="lblText" width="10%" >Credit Account</TD>

                                                                       <TD><INPUT TYPE="text"  class="textBox" NAME="credAcc"

                                                                              id="credAcc" disabled ></TD>




                                                                       <td width="5%">&nbsp;</td>

                                                                       <TD class="lblText" width="10%">Debit Account</TD>

                                                                       <TD><INPUT TYPE="text" class="textBox" NAME="debtAcc"

                                                                              id="debtAcc" disabled></TD>

                                                                 </TR>

                                                                 </table>

                                                                 </div>

i have two jsp page i my first jsp page i have, in div , and anather jsp page i calling thrown function when i click select flow in ‘S’ i have hide this divotherwise not…

With statement are not allowed in strict mode, NextJS, Typescript issue in turndown package

I’m developing a NextJS application using TypeScript, I used a package called turndown and turndown, but I’m getting this error in the compile time, how to fix this issue, thanks in advance

Failed to compile

./node_modules/domino/lib/sloppy.js
Error: 
  × With statement are not allowed in strict mode
    ╭─[/Users/prasathsivanathan/Desktop/whatsapp edit/whatsapp-text-formatter/node_modules/domino/lib/sloppy.js:7:1]
  7 │ module.exports = {
  8 │   Window_run: function _run(code, file) {
  9 │     if (file) code += 'n//@ sourceURL=' + file;
 10 │     with(this) eval(code);
    ·     ────
 11 │   },
 12 │   EventHandlerBuilder_build: function build() {
 13 │     try {
    ╰────

  × With statement are not allowed in strict mode
    ╭─[/Users/prasathsivanathan/Desktop/whatsapp edit/whatsapp-text-formatter/node_modules/domino/lib/sloppy.js:11:1]
 11 │   },
 12 │   EventHandlerBuilder_build: function build() {
 13 │     try {
 14 │       with(this.document.defaultView || Object.create(null))
    ·       ────
 15 │         with(this.document)
 16 │           with(this.form)
 17 │             with(this.element)
    ╰────

  × With statement are not allowed in strict mode
    ╭─[/Users/prasathsivanathan/Desktop/whatsapp edit/whatsapp-text-formatter/node_modules/domino/lib/sloppy.js:12:1]
 12 │   EventHandlerBuilder_build: function build() {
 13 │     try {
 14 │       with(this.document.defaultView || Object.create(null))
 15 │         with(this.document)
    ·         ────
 16 │           with(this.form)
 17 │             with(this.element)
 18 │               return eval("(function(event){" + this.body + "})");
    ╰────

  × With statement are not allowed in strict mode
    ╭─[/Users/prasathsivanathan/Desktop/whatsapp edit/whatsapp-text-formatter/node_modules/domino/lib/sloppy.js:13:1]
 13 │     try {
 14 │       with(this.document.defaultView || Object.create(null))
 15 │         with(this.document)
 16 │           with(this.form)
    ·           ────
 17 │             with(this.element)
 18 │               return eval("(function(event){" + this.body + "})");
 19 │     }
    ╰────

  × With statement are not allowed in strict mode
    ╭─[/Users/prasathsivanathan/Desktop/whatsapp edit/whatsapp-text-formatter/node_modules/domino/lib/sloppy.js:14:1]
 14 │       with(this.document.defaultView || Object.create(null))
 15 │         with(this.document)
 16 │           with(this.form)
 17 │             with(this.element)
    ·             ────
 18 │               return eval("(function(event){" + this.body + "})");
 19 │     }
 20 │     catch (err) {
    ╰────

Caused by:
    Syntax Error
This error occurred during the build process and can only be dismissed by fixing the error.

Case insensitive search jQuery [duplicate]

Please help me with a question.

There is html with this structure (simplified):

<div id="data">
   <div description="Andy">
      <div class="ig"><a href="#"><img src="#"></a></div>
      <div>Andy</div>
   </div>
   <div description="Cramly">
      <div class="ig"><a href="#"><img src="#"></a></div>
      <div>Crasly</div>
   </div>
   <div description="Sam">
      <div class="ig"><a href="#"><img src="#"></a></div>
      <div>Sam</div>
   </div>
</div>

And there is a search text field with the id “find”.
The task is to ensure that when you enter in this field, only will remain whose part matches the entered one.
I made this script:

<script type="text/javascript">
    $('#find').change(function(){
        var filter = $(this).val();
        if (filter) {
            $matches = $('#data').find(':Contains(' + $('#find')[0].value + ')');
            $('div[description]','#data').not($matches).hide();
            $matches.slideDown();
        } else {
            $('#data').find('div').show();
        } return false;
        })
        .keyup( function () {
            $(this).change();
        });
</script>

It works but is case sensitive.
I just can’t make the search case-insensitive.
How can I change the code? Or maybe use some other method?