Ajax POST happens multiple times per page load.

Created on 15 October 2023, 12 months ago

Problem/Motivation

The javascript is triggered multiple times per page load, which in turn makes an ajax call to /timezone-detect/ajax/set-timezone

The problem is drupalBehaviors is executed multiple times on the page, before /timezone-detect/ajax/set-timezone has a chance to finish.

The ajax request should only happen, at max, once per page load.

Proposed resolution

Either use once() or $( document ).ready() when making the ajax call, to ensure it only happens once per page load.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024