Issue with Tailwind CSS and shadcn/ui in applying background opacity to custom colors

I’m encountering an unexpected behavior when using Tailwind CSS in conjunction with shadcn/ui library for styling buttons. The problem arises when attempting to apply background opacity to a custom color defined in globals.css using HSL values as follows:

--primary: 348, 76%, 64%;

The issue occurs when trying to set the background opacity of a button using this custom color in shadcn/ui. For instance:

<button class="hover:bg-primary/90">Button</button>

The intention here is to have a button with a hover effect that applies 90% opacity to the background color defined as –primary. However, this opacity setting seems to have no effect, and the button retains its original opacity.

I have ensured that the custom color is properly defined and available in the project’s global styles. Yet, applying opacity to it using the Tailwind utility classes does not yield the expected result.

Blocked a frame with origin “http://localhost:5173

My Frontend is running on http://localhost:5173 (vue)
My backend is running on http://localhost:8000 (laravel rest api)

Problem :-
When i add http://localhost:8000 in a iframe in my vue frontend
(basically i wanna show laravel home screen in my frontend using iframe )
But the problem is when i try to access the dom of iframe content it gives me error that Blocked a frame with origin “http://localhost:5173”
But if i add http://localhost:5173 ( frontend home screen ) it works perfectly fine
My question is how can i give access my frontend from laravel backend so i can access document in my frontend

 <iframe
                    v-if="size === 'L' && !isLoading && !error"
                    @click="handlePopup"
                    src="http://localhost:8000"
                    class="!cursor-text scroll-smooth"
                    sandbox="allow-scripts allow-forms allow-same-origin allow-pointer-lock allow-                           presentation allow-popups allow-popups-to-escape-sandbox"
                    style="border: 0; width: 100%; height: 100%"
                    :onLoad="
                        () => {
                            initializeIframe();
                        }
                    "
                    ref="iframeRef"
                    allow-same-origin
                ></iframe>

How can I change material of specific element if it shares mesh with others?

I’m working on simulation of building IFC model in time. I want elements to change its material when they reach their timeEnd. It works, but the problem is that elements share same mesh, so when 1 element of mesh reaches timeEnd, it changes material of whole mesh. Should I clone mesh for every element, then change its material?

function processTimeStep(entry, time) {
const expressID = entry.expressID;
const isStartTime = entry.timeStart === time 
const isEndTime = entry.timeEnd === time
const fragmentId = findFragmentIdByExpressId(expressID, model.getFragmentMap([expressID]));
const fragmentMap = model.getFragmentMap([expressID]);
if (fragmentId) {
    const fragment = fragments.list[fragmentId];
        const itemMesh = fragment.mesh; 
        if (isStartTime) {
             hider.set(true, fragmentMap)
        } else if (isEndTime) {
            itemMesh.material = fragment.originalMaterial;

        }
    }
}

Script Engine in Service

I want to run JavaScript code using Script Engine. I found a project called Rhino-android, and I got the desired result when I clicked the button in Activity. However, when I implemented it to work in Service, it came out that there is no Script Engine Factory. Can you help me with this?

implement Project.

    implementation 'com.sun.phobos:jsr223-api:1.0'
    implementation 'io.apisense:rhino-android:1.0'
    implementation group: 'org.mozilla', name: 'rhino', version: '1.7.13'
   ScriptEngineManager manager = new ScriptEngineManager();
   Log.d(TAG, "manager = " + manager);
   List<ScriptEngineFactory> list = manager.getEngineFactories();
   Log.d(TAG, "list = " + list);
   for (ScriptEngineFactory factory: list){
      Log.i(TAG, "factory = " + factory.getEngineName() + ", engines = " + factory.getNames());
   }

system pointing with update sql

`Hello everyone,
I am a beginner in php development. I am looking for a solution to clock the presence of my members in javascript, and at the same time update my table based on the id.

Here’s what I started doing:

_ 2 requests:

$present=update_examination_present($EXAM_id);

$absent=update_examination_absent($EXAM_id;

_ Button of my table:

`<td><INPUT type=”button” class=”btn btn-warning” title=”Pointing of <?php echo $list_pgChildren[$a][‘ADHE_nom’].” “.$list_pgChildren[$a][‘ADHE_prenom’]; ?>” value=”POINTAGE” onclick=”myFunction(this);pointage(a)”></INPUT> <?php`your text` } elseif($list_pgChildren[$a][‘EXAM_present’]==1) { ?> <INPUT type=”button” class=”btn btn-success” title=”Modifying <?php echo $list_pgChildren[$a][‘ADHE_nom’].” “.$list_pgChildren[$a][‘ADHE_prenom’]; ?>” value=”PRESENT” onclick=”myFunction(this)”></INPUT> <?php } ?>`

_ my script which works with my “INPUT type=button”:

<script language="JavaScript" type="text/javascript">function myFunction(anObject){ if (anObject.value == "POINTING"){ //alert('I'm doing this'); anObject.value = "PRESENT"; }else { //alert('I do this'); anObject.value = "POINTAGE";}}</script>

I would like to integrate my 2 requests into the script:

_ if I click the first time on my “POINTAGE” button, it executes my “$present” query and displays “PRESENT” on my button.

_ if I click again on this same “PRESENT” button, it executes my “$absent” query and displays “POINTAGE” on my button.
Can you help me please?

Alternative to Fuse JS (FuzzySearch Javascript)

i have 33k+ Records of Product in Indexed DB. i have implemented search for that using Fuse js. But For my some cases it wouldn’t give proper results. i played with its options but not got satisfied results. So looking for alternative minimal size & wide in functionality of fuzzy search.

Please let me know if you have used or know any js that can give results in most of complex searchs. i am trying to make similar version of DoFinder

Detect when link element loads and the href changes

I am trying to implement theming on a web application. Currently there are several themes and a panel from which the user can change the theme.
I want to register an event and detect when the theme loads.
The code is as follows:

const link = document.createElement('link')
link.rel = 'stylesheet'
link.href="first-theme.css'
link.onload = () => console.log('Theme loaded')

document.head.append(link)

This works fine when the first theme is set and the link element is created.

However, the problem is when I try to change the theme.
When I change the theme, I don’t create a new link element, but rather update the href of the existing one.

function changeTheme(theme){
  link.href=theme
}

When I call changeTheme, the onload event is not fired again, even though the new file is loaded.

As a side note, this workflow works on the img tag

const img = document.createElement('img')
img.src='https://picsum.photos/200'
img.onload = () => console.log("Image loaded")

document.body.append(img)

setTimeout(() => img.src='https://picsum.photos/300', 1000)
setTimeout(() => img.src='https://picsum.photos/400', 2000)

The above code will print Image loaded for 3 times.

How to create an initial value in Lexical rich text, then edit it?

I use the Lexical library from Facebook as a WYSIWYG component but I don’t know how to create the initial value?
After searching for a long time, I took the initiative to throw it on this forum, hopefully someone can help.

this my code:

import ExampleTheme from "./themes/ExampleTheme";
import { LexicalComposer } from "@lexical/react/LexicalComposer";
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
import TreeViewPlugin from "./plugins/TreeViewPlugin";
import ToolbarPlugin from "./plugins/ToolbarPlugin";
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
import { ListItemNode, ListNode } from "@lexical/list";
import { CodeHighlightNode, CodeNode } from "@lexical/code";
import { AutoLinkNode, LinkNode } from "@lexical/link";
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
import { TRANSFORMERS } from "@lexical/markdown";
import ImagesPlugin from "./plugins/ImagesPlugin";

import ListMaxIndentLevelPlugin from "./plugins/ListMaxIndentLevelPlugin";
import CodeHighlightPlugin from "./plugins/CodeHighlightPlugin";
import AutoLinkPlugin from "./plugins/AutoLinkPlugin";
import React, { useEffect, useState, useRef } from "react";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
import { ImageNode } from "./nodes/ImageNode";

function Placeholder() {
  return <div className="editor-placeholder">Enter some rich text...</div>;
}

const loadContent = async () => {
  // read from database, local storage, etc.
  const value =
    '{"root":{"children":[{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1}],"direction":null,"format":"","indent":0,"type":"root","version":1}}';
  return value;
};

const editorConfig = {
  // The editor theme
  theme: ExampleTheme,
  // Handling of errors during update
  onError(error) {
    throw error;
  },
  // Any custom nodes go here
  nodes: [
    HeadingNode,
    ListNode,
    ListItemNode,
    QuoteNode,
    CodeNode,
    CodeHighlightNode,
    TableNode,
    TableCellNode,
    TableRowNode,
    AutoLinkNode,
    LinkNode,
    ImageNode,
  ],
};

export default function Editor() {
  const initial = {
    root: {
      children: [
        {
          children: [
            {
              detail: 0,
              format: 0,
              mode: "normal",
              style: "color: #f5a623;",
              text: "Hello World!",
              type: "text",
              version: 1,
            },
          ],
          direction: "ltr",
          format: "",
          indent: 0,
          type: "paragraph",
          version: 1,
        },
      ],
      direction: "ltr",
      format: "",
      indent: 0,
      type: "root",
      version: 1,
    },
  };

  const [editorState, setEditorState] = useState(JSON.stringify(initial));
  const [value, setValue] = useState(null);

  const OnChangePlugin = ({ onChange }) => {
    const [editor] = useLexicalComposerContext();
    useEffect(() => {
      return editor.registerUpdateListener(({ editorState }) => {
        onChange(editorState);
      });
    }, [editor, onChange]);
  };

  const onChange = (state) => {
    // Call toJSON on the EditorState object, which produces a serialization safe string
    const editorStateJSON = state.toJSON();

    setEditorState(JSON.stringify(editorStateJSON));
  };

  console.log(editorState); // show value before parse to html

  return (
    <>
      <LexicalComposer initialConfig={editorConfig}>
        <div className="editor-container">
          <ToolbarPlugin />
          <div className="editor-inner">
            <RichTextPlugin
              contentEditable={<ContentEditable className="editor-input" />}
              placeholder={<Placeholder />}
              ErrorBoundary={LexicalErrorBoundary}
            />
            <HistoryPlugin />
            <TreeViewPlugin setValue={(val) => setValue(val)} />
            <AutoFocusPlugin />
            <CodeHighlightPlugin />
            <ListPlugin />
            <LinkPlugin />
            <AutoLinkPlugin />
            <ImagesPlugin />
            <OnChangePlugin onChange={onChange} />
            <ListMaxIndentLevelPlugin maxDepth={7} />
            <MarkdownShortcutPlugin transformers={TRANSFORMERS} />
          </div>
        </div>
      </LexicalComposer>

      <div dangerouslySetInnerHTML={{ __html: value }} />
    </>
  )
}

the documentation is very minimal and I don’t understand it, what should be done to modify it? and is there a tutorial or answer regarding this?

I want to add a background to my wordpress website in three.js, creating a wireframe I don’t manage to put a sphere at the extremity of each line

So I have a turquoise diamond, I would like to add a directional camera from the camera. This will be a bg in a WordPress section (also don’t know how to do.

So my issue here is I have created a wireframe here that is over the diamond, but I am trying to get 3d spheres to stick onto every intersection of lines, I don’t know why it never seems to work, I have read the wireframe mesh page of three.js but nothing moves. what am I doing wrong?

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Amba</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <!-- <link type="text/css" rel="stylesheet" href="main.css"> -->

    <style>
        body {
    margin: 0;
    background-color: #000;
    color: #fff;
    font-family: Monospace;
    font-size: 13px;
    line-height: 24px;
    overscroll-behavior: none;
}

a {
    color: #ff0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    text-transform: uppercase;
}

#info {
    position: absolute;
    top: 0px;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
    z-index: 1; /* TODO Solve this in HTML */
}

a, button, input, select {
    pointer-events: auto;
}

.lil-gui {
    z-index: 2 !important; /* TODO Solve this in HTML */
}

@media all and ( max-width: 640px ) {
    .lil-gui.root { 
        right: auto;
        top: auto;
        max-height: 50%;
        max-width: 80%;
        bottom: 0;
        left: 0;
    }
}

#overlay {
    position: absolute;
    font-size: 16px;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0,0,0,0.7);
}

    #overlay button {
        background: transparent;
        border: 0;
        border: 1px solid rgb(255, 255, 255);
        border-radius: 4px;
        color: #ffffff;
        padding: 12px 18px;
        text-transform: uppercase;
        cursor: pointer;
    }

#notSupported {
    width: 50%;
    margin: auto;
    background-color: #f00;
    margin-top: 20px;
    padding: 10px;
}

    </style>
</head>
<body>

    <script type="importmap">
        {
            "imports": {
                "three": "../build/three.module.js",
                "three/addons/": "./jsm/",
                "three-subdivide": "https://unpkg.com/[email protected]/build/index.module.js"
            }
        }
    </script>

    <script type="module">

      import * as THREE from 'three';
      import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

      let camera, scene, renderer, controls;
      let diamond, wireframe, circle1, circle2;

      init();
      animate();

      function init() {
        camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 100);
        camera.position.set(0, 0, 10);

        scene = new THREE.Scene();
  // Directional light
  const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
            directionalLight.position.set(0, 1, 1);
            scene.add(directionalLight);

              // Directional light
  const directionalLight2 = new THREE.DirectionalLight(0x008080, 1);
            directionalLight2.position.set(-1, 0, 2);
            scene.add(directionalLight2);
      // Create diamond geometry
      const diamondGeometry = new THREE.IcosahedronGeometry(3.5, 0);
            const diamondMaterial = new THREE.MeshPhongMaterial({ color: 0x008080, specular: 0x00ff00, shininess: 50 });
            diamond = new THREE.Mesh(diamondGeometry, diamondMaterial);
            scene.add(diamond);





            // // Create wireframe geometry
            // const wireframeGeometry = new THREE.EdgesGeometry(diamondGeometry);
            // const wireframeMaterial = new THREE.LineBasicMaterial({ color: 0xffffff });

            // wireframe = new THREE.LineSegments(wireframeGeometry, wireframeMaterial, wireframeLinejoin );
            // wireframe.scale.set(1.5, 1.5, 1.5); // Double the size
    
            // scene.add(wireframe);
            // Create wireframe geometry
const wireframeGeometry = new THREE.EdgesGeometry(diamondGeometry);
const wireframeMaterial = new THREE.LineBasicMaterial({ color: 0xffffff });

// Create wireframe using LineSegments
wireframe = new THREE.LineSegments(wireframeGeometry, wireframeMaterial);
wireframe.scale.set(1.5, 1.5, 1.5); // Double the size

// Add spheres at the end of each line segment
const vertices = diamondGeometry.attributes.position.array;
const numVertices = vertices.length / 3;

const sphereGeometry = new THREE.SphereGeometry(0.1, 16, 16);
const sphereMaterial = new THREE.MeshPhongMaterial({ color: 0xffffff });

for (let i = 0; i < numVertices; i++) {
    const x = vertices[i * 3];
    const y = vertices[i * 3 + 1];
    const z = vertices[i * 3 + 2];

    const sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);
    sphere.position.set(x, y, z);
    scene.add(sphere);
}

scene.add(wireframe);

// mesh = new THREE.Mesh( geometry, material );
//     scene.add( mesh );
    

//      var wireframe = new THREE.LineSegments( wireframeGeometry, wireframeMaterial );
//     mesh.add( wireframe );

//     renderer = new THREE.WebGLRenderer( { antialias: true } );
//     renderer.setSize( window.innerWidth, window.innerHeight );
//     document.body.appendChild( renderer.domElement );

// Add circles at the ends of each line in the wireframe
                addCirclesAtWireframeEnds(wireframe);


        const circleGeometry1 = new THREE.CircleGeometry(0.2, 10);
        const circleMaterial = new THREE.MeshBasicMaterial({ color: 0xffffff });
        circle1 = new THREE.Mesh(circleGeometry1, circleMaterial);
        scene.add(circle1);

        const circleGeometry2 = new THREE.CircleGeometry(0.2, 32);
        circle2 = new THREE.Mesh(circleGeometry2, circleMaterial);
        scene.add(circle2);

        const floorGeometry = new THREE.PlaneGeometry(100, 100);
        const floorMaterial = new THREE.ShadowMaterial({ opacity: 0.5, color: new THREE.Color(1, 1, 1) });
        const floor = new THREE.Mesh(floorGeometry, floorMaterial);
        floor.rotation.x = -Math.PI / 2;
        floor.position.y = -3.5; // Adjusted the position to be below the diamond
        floor.receiveShadow = true;
        scene.add(floor);

        renderer = new THREE.WebGLRenderer({ antialias: true });
        renderer.setPixelRatio(window.devicePixelRatio);
        renderer.setSize(window.innerWidth, window.innerHeight);
        renderer.shadowMap.enabled = true;
        document.body.appendChild(renderer.domElement);

        controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
controls.dampingFactor = 0.25;
controls.screenSpacePanning = false;
controls.maxPolarAngle = Math.PI / 2;
controls.enableZoom = false; // Disable zooming

        window.addEventListener('resize', onWindowResize);
      }

      function addCirclesAtWireframeEnds(wireframe) {
                const circleGeometry = new THREE.SphereGeometry(0.1, 40, 10);
                const circleMaterial = new THREE.MeshBasicMaterial({ color: 0xffffff });

                const vertices = wireframe.geometry.attributes.position.array;

                for (let i = 0; i < vertices.length; i += 6) {
                    const x = vertices[i];
                    const y = vertices[i +1 ];
                    const z = vertices[i + 2];

                    const circle = new THREE.Mesh(circleGeometry, circleMaterial);
                    circle.position.set(x, y, z);
                    scene.add(circle);
                }
            }


      function onWindowResize() {
        camera.aspect = window.innerWidth / window.innerHeight;
        camera.updateProjectionMatrix();
        renderer.setSize(window.innerWidth, window.innerHeight);
      }

      function animate() {
        requestAnimationFrame(animate);

        diamond.rotation.x += 0.005;
        diamond.rotation.y += 0.01;
        wireframe.rotation.x += 0.005;
        wireframe.rotation.y += 0.01;
      

        controls.update();

        renderer.render(scene, camera);
      }
    </script>
  </body>
</html>

I am so sorry for not putting cdn’s, they don’t seem to work, I amworking on this file in the three.js examples folder.

So this is my reference image of ideally what I would have liked as a shape
disamond+wireframe

And here would be the end result on each corner :
sphere on wireframe intersection

This is my isosahedron rotating with the wireframe that is 1,5x bigger that the diamond and as you can see the sphere dont seem to stick to the wirefrane. The two chapes are rotating and a reactive to orbit controls but the spheres dont rotate.

How do I access the html object I add the event listener to instead of the item being clicked in js?

I have an event listener for an object and when I click the object it’s fine, but when I click the child, event.target returns the child. Is there a way to make it so that it only returns the object I assigned the event listener to?

This is what I have as of now:

function myFunction(event) {
    if (event.target == something) {
        console.log('test') // expected test every time I click the object something in the html
    }
}

something.addEventListener('click', myFunction)
somethingelse.addEventListener('click', myFunction)

It only logs ‘test’ in the console when I click the margin/padding outside of the child because technically the event.target is not ‘something’ and rather the child of something.

Is there any way to access the object I am adding the event listener to (something) rather than the item being clicked?

Thanks.

redirecting to the login page on onClick react

hasRole("HQADMIN", props.userDetails) || hasAdminRight("MANAGE_CUSTOMERS", props.userDetails) || hasRole("CALL_CENTER", props.userDetails) || hasRole("REPORT_CALL_CENTER", props.userDetails) ?
                <ListItem selected={location.pathname === '/admin/users'}
                    onClick={() => props.redirect('/admin/users')} button>
                    <ListItemIconExt>
                        <i className="fa fa-user-circle" />
                    </ListItemIconExt>
                    <ListItemText primary={<FormattedMessage id="sidebar.items.admin.users" defaultMessage="Users" />} />
                </ListItem> : null}

                {hasRole("MANAGE_USER_FORMS", props.userDetails) ? 
                <ListItem selected={location.pathname === '/admin/userforms'}
                    onClick={() => props.redirect('/admin/userforms')} button>
                    <ListItemIconExt>
                        <i className="fa fa-user-circle" />
                    </ListItemIconExt>
                    <ListItemText primary={<FormattedMessage id="sidebar.items.admin.userforms" defaultMessage="Manage User Forms" />} />
                </ListItem>
            : null}

Here is the router configurations for my app

<ConnectedRouter history={props.history}>
                <Switch>
                    <Main>
                        <Switch>
                            <Route path="/dashboard" component={DashBoardPage}/>
                            <Route path="/reports" component={ReportsPage}/>
                            <Route path="/login" component={LoginPage}/>
                            <Route path="/p3/invoice" component={P3InvoicePage}/>
                            <Route path="/admin/rda" component={RdaPage}/>
                            <Route path="/admin/users" component={AdminUsersPage}/>
                            <Route path="/admin/notifications" component={AdminNotificationsPage}/>
                            <Route path="/admin/charities" component={AdminCharitiesPage}/>
                            <Route path="/admin/billers" component={AdminBillersPage}/>
                            <Route path="/admin/documents" component={DocumentsPage}/>
                            <Route path="/admin/branches" component={BranchesPage}/>
                            <Route path="/admin/banks" component={BanksPage}/>
                            <Route path="/admin/change_requests" component={ChangeRequestsPage}/>
                            <Route path="/admin/portal_users" component={UsersPage}/>
                            <Route path="/admin/globals" component={GlobalsPage}/>
                            <Route path="/admin/blacklist" component={Blacklist}/>
                            <Route path="/admin/userforms" component={AdminUserForm}/>
                            <Route path="*" component={NotFoundPage}/>
                        </Switch>
                        <div style={{position: "absolute", left: "30px", bottom: "30px", fontSize: "60px", opacity: "0.1", fontWeight: "900", userSelect: "none", pointerEvents: "none", zIndex: 100000}}>
                            {(env.NODE_ENV && env.NODE_ENV !== "prod") ? env.NODE_ENV.toUpperCase() : ""}<br/>
                        </div>
                    </Main>
                </Switch>
            </ConnectedRouter>

there are two things here the one with the above i call it when one of them condition is true and the below one i call when role is MANAGE_USER_FORMS but when i click on the Manage User Forms tab it redirects me to the login page why is this happening if it is because of adminRights then CALL_CENTER role also does not have a admin rights it’s null sem for MANAGE_USER_FORMS but the problem i seeing is it remove my auth-token from the sessionStorage that’s why it redirects me to the login page

jQuery.Deferred exception: $(…).select2 is not a function

I have a searchable dropdown in file “index.php” and I am trying to populate the dropdown options using jQuery. Using jQuery I am making an ajax request to fetch data from mySQL database through file “get_states.php”.
index.php is like this :

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>

<!-- Select2 JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected] 
rc.1/dist/js/select2.min.js"></script>

<script>
    // Initialize Select2 to load dropdown dynamically
    $(document).ready(function() {
        $('.select2').select2({
            placeholder: 'Search for a state',
            ajax: {
                url: 'get_states.php', // PHP script to fetch states dynamically
                dataType: 'json',
                delay: 250,
                processResults: function(data) {
                    return {
                        results: data
                    };
                },
                cache: true
            }
        });
    }); 

Also from the same index.php file I am making a different ajax request through xhr object to execute “code.php” .However I am getting this error “jQuery.Deferred exception: $(…).select2 is not a function TypeError: $(…).select2 is not a function
at HTMLDocument.”

I want the getstates.php to execute and get the data from database.

How to overlay WMS layer on 3D Tiles in Cesium?

When I try to overlay a WMS layer on top of a 3D Tiles model, I find that the 3D Tiles model always covers any layers. I have checked the official documentation of Cesium and there doesn’t seem to be a direct API available for this. How can I overlay this WMS layer on top of the 3D Tiles model? Thank you everyone in advance.

I have tried setting the WMS layer as a material and also setting it as a PNG, but the issue remains.