Failure to display dynamic information from the database in fancytree

I entered fancyTree into apex and when I use static data, the tree is displayed well, but I want the data to be displayed from the database, and for this I created a restful api that outputs json, but when the url is displayed in the field I put javascript, it doesn’t show anything! Why is it like that? What should I do to fix it?

This is my javascript code:

    $("#tree1").fancytree({
  checkbox: true,
  selectMode: 3,
  source: {
    url:
      "http://localhost:5080/ords/test/fancyTree/api"
  },
   lazyLoad: function(event, data) {
    data.result = {url: "http://localhost:5080/ords/test/fancyTree/api"};
  }, 
});

This is a simple query:

select 
    id as key
    ,code ||'-' || name as title
from  vE5ProcessTreeLight 
start with id=15095794414151206135  connect by   nocycle prior id=  parent_id
order siblings by eqptype,name

can`t choosing variables after using ajax

I made a product slider inside WooCommerce that displays the products and you can choose which category to display the products. By selecting the category, the products are changed using Ajax. Now my problem is that when the category is not selected, it means that the Ajax is not executed. You can select the product variables, i.e. product color and size, but after choosing the category that new products are added with Ajax, you can`t select the product variables.

html

  <input type="hidden" name="variation_id" value="<?php echo $available_variations[0]['variation_id']; ?>">
                                <?php foreach ($variations as $key => $value): ?>
                                    <div class="d-flex">
                                        <div class="d-flex var_list">
                                            <?php foreach ($value as $var): ?>
                                                <div class="button-group">
                                                    <input type="radio" class="variation-attributes" name="attribute_<?php echo $key ?>" value="<?php echo $var; ?>" id="<?php echo $var; ?>-<?php echo $product_id ?>">
                                                    <?php if ($key === "pa_color"): ?>
                                                        <label style="background-color: <?php echo $color[$var] ?>; " class="variation-attributes pa_color" name="attribute_<?php echo $key ?>" id="<?php echo $var; ?>" for="<?php echo $var; ?>-<?php echo $product_id ?>"></label>
                                                    <?php else: ?>
                                                        <label class="variation-attributes" name="attribute_<?php echo $key ?>" id="<?php echo $var; ?>" for="<?php echo $var; ?>-<?php echo $product_id ?>"><?php echo $var; ?></label>
                                                    <?php endif; ?>
                                                </div>
                                            <?php endforeach;  ?>
                                        </div>
                                    </div>

                                <?php endforeach; ?>

js

 $(".variation-attributes").click(function () {
    var label = $(this);
    var input = label.siblings("input")[0];
    input.checked = true;
    let $forms = $(this).closest("form.cart");
    const $variationsData = $forms.data("product_variations");
    const $price = $forms.find(".price_variations");
    const $variationIdInput = $forms.find('input[name="variation_id"]') || 0;
    const $selectedTerms = $forms
      .find(".variation-attributes:checked")
      .map((idx, attr) => {
        const attrObj = {};
        attrObj[attr.name] = $(attr).val();
        return attrObj;
      }) 
      .toArray();
    const matchedVariation = $variationsData.find((variation) => {
      return $selectedTerms.every((term) => {
        const key = Object.keys(term)[0];
        return variation.attributes[key] == term[key];
      });
    });
    const variationId = matchedVariation.variation_id;
    const priceHtml = matchedVariation.price_html;

    $price.html(priceHtml);
    $variationIdInput.val(variationId);
  });

These are my codes that work before Ajax, but do not work after Ajax

Expo stucked on splash screen after redirecting

issue in my Expo app? After logging in and redirecting to the homepage, the app gets stuck on the splash screen. This issue only occurs after building the APK—everything works fine in Expo Go

Can anyone help me with an issue in my Expo app? After logging in and redirecting to the homepage, the app gets stuck on the splash screen. This issue only occurs after building the APK—everything works fine in Expo Go

Reading from a ReadableStreamDefaultReader of transferred WebTransportReceiveStream (ReadableStream) to worker leads to DataCloneError

After trying a similar example to what is found at whatwg, both Firefox and Chrome fail at reader.read() with a DataCloneError: A ReadableStream could not be cloned because it was not transferred. on the worker, but the worker has successfully received the transferred ReadableStream. Is this just that the browsers I’m using do not support this functionality or am I doing something wrong?

In theory a WebTransportReceiveStream is a transferable object, I have the following reduced files for my code.

worker.js:

onmessage = async (evt) => {
  const rs = evt.data;
  const reader = rs.getReader();
  const {value, done} = await reader.read();
  console.error(value);
};

main.js:

async function setup() {
  const t = new WebTransport('https://localhost:4443');
  await t.ready
  const uds = t.incomingUnidirectionalStreams;
  const w = new Worker('worker.js');
  w.postMessage(uds, [uds]);
}

await setup();

index.html:

<!DOCTYPE html>
<html>
  <head>
    <script type="module" src="main.js"></script>
  </head>
  <body>
  </body>
</html>

CARGAR ARCHIVO JS CON AJAX [closed]

disculpen tengo una duda, estoy haciendo un panel administrativo de un sistema de ventas con AJAX, tengo un menú lateral y en un tag section se cargan las opciones de menú, cada uno de los archivos que se cargan en el section tiene un archivo JS propio, mi duda es, ¿Cómo hago para cargar ese archivo JS de esa opción usando AJAX?, muchas gracias

Ya busque información por Internet pero no me ha sido de ayuda

Quel sont les raison pour lesquelles une implémentation de code sans erreur syntaxique ne puisse pas fonctionner? [closed]

En javascript, j’essaie de vouloir créer une application qui génère le code QR pour l’implémenter en RA mais le formulaire de présentation de mon QR est bien afficher sauf qu’aucun des mes bouton ne fonctionne. Que faire s’il vous plait ?

J’ai vérifier la version de JavaScript que j’ai utiliser, j’ai procéder a une vérification entière du code pour m’assurer qu’il n’a pas d’erreur syntaxique. J’aimerais que l’on m’aider a déceler les erreur de logique;

Write scripts to do commands on firefox or chrome

I am going through a discussions forum and am trying to download each page as I search through the discussions that I am looking for. This is my process:

  1. Ctrl + f and type in 003 :Discussions that have 003 in the name are highlighted on the page.

  2. Ctrl + left click : open up a new tab for a discussion with 003 in it

  3. Ctrl + s and enter : save the tab

  4. Ctrl + w : closes the tab

It is tedious and am wondering if it’s possible to write a script to help automate the process. I figured it’s reasons like this that people start to code .. automation and making our lives easier. If anyone has any ideas or tips please share. Have a feeling that javascript can be used to accomplish this but I am just guessing.

img src is in array of object, using async await but images do not appear in react app

const [decks, setDecks] = useState();
const [loading, setLoading] = useState(true);

function getCardImage(decks){
        decks.map(async(deck)=>{
            deck.img = await MagicApi.getCardImage(deck.commander);
        })
        return decks;
    }
    
    useEffect(()=>{
        const gettingDecks = async (userInfo) => {
            const res = await UserApi.getDecks(userInfo);
            const res2 = await getCardImage(res);

            setDecks(res2);
            setLoading(false);
        }
        gettingDecks({id})
    },[]);

if(loading) return <div><h3>Fetching Your Commander Decks...</h3></div>
    
    console.log(decks)
        return(
        
            <Row>
                
                {decks.map(deck => {
                    return (
                    <Card key={crypto.randomUUID()}>
                            
                            <CardImg
                                alt="Card image cap"
                                src={deck.img}
                                style={{height: 300}}
                                top
                                width="50%"/>

                            <CardTitle><h3>{deck.commander}</h3></CardTitle>
                            
                            <CardBody>
                                <p>{deck.colors}</p>
                            </CardBody>
                            
                            <Button onClick={() => deleteDeck(deck)}>Delete</Button>
                        
                    </Card>
                    )
                })}
                
            </Row>
        )

when i look at the components in the dev tools it says my img src is undefined. but when i console.log before my return it shows the img url from the api.

been trying to google for a while and just cant find anything. I want the images to be shown on render.

Thank you in advance for any help!

Angular: Await method do not execute the route.navigate() present inside the setTimeout?

I faced a weird issue when I am integrating a async routing above the await method. If I remove the await method, I can see the routing id working as expected. Below I am giving the code sample.

async deleteApplication() {
        const confirm = await this._prompt.showDelteConfirm(this.application.name);
        if (confirm) {
            // Block 1 start
            setTimeout(async () => {
                try {
                    await this._router.navigate(['/tenant']);
                    console.log('redirected.');
                } catch (error) {
                    console.error('Error navigating within tenant:', error);
                }
            }, 5000);
            // Block 1 end

            // BLock 2 start
            const {result} = await this._applicationService.delete();
            if (result === 'Success') {
                await this._projectSpaces.request();
                await this._router.navigate(['/tenant']);
            }
            // BLock 2 end
        }
    }

I suppose to redirect to a new route after few seconds (i.e after 5sec) as soon as after the delete() service started.
If block 1 and Block 2 execute at a time, When await methods start executing then the routing method present inside the block 1 is not executing.
Don’t understand this kind of weird issue.

I need your thought on this.

Inspect Element [closed]

Here is the rewritten message:

“Hello,

I’m experiencing an issue with my Shopify store. On the order confirmation page, there’s an unwanted small icon/image behind the ‘Cash on Delivery (COD)’ text. Using Inspect Element, I found the corresponding Div code in the HTML section. However, I’m struggling to locate the original file within my Shopify store due to the numerous files.

Could someone please guide me on how to find the exact file containing this Div code? I’ve tried searching but need a more efficient solution.

Thanks

How to go to the First slide when reaching the last slide?

I have this slider that works just fine. However, when it reaches the last slide I want it to keep moving to the RIGHT and show SLIDE 1. My issue is that once it reaches the last slide it moves to SLIDE 1 but it moves to the LEFT. Can anyone point me in the right direction, please? Thanks a lot in advance!

Here’s my LIVE DEMO: https://stackblitz.com/edit/react-ubg8sg?file=src%2FApp.js,src%2Fassets%2Fdata.js,src%2Fstyle.css,src%2Findex.css,src%2Findex.js

Here’s my function that handles the scrolling:

    const scrollToImage = (direction) => {
    if (direction === 'prev') {
      setCurrentIndex((curr) => {
        const isFirstSlide = currentIndex === 0;
        return isFirstSlide ? 0 : curr - 1;
      });
    } else {
      const isLastSlide = currentIndex === data.length - 1;
      if (!isLastSlide) {
        setCurrentIndex((curr) => curr + 1);
      } else {
        setCurrentIndex(0);
      }
    }
  };

Canvas with webgl becomes broken after some time

I have a page where I use multiple canvases with webgl2 context. When I load or refresh page everything works good (rendering in canvases). But if I go to other tab in browser or switch focus to other app, and then return back to my page some canvases may become broken.

In my case “broken” means following:

Double buffering seems not to work correctly. In one buffer drawing seems to be working, in other buffer not. Broken buffer just displays the same frame each time. So I see blinking in canvas.

I want to know if I can fix such behavior or somehow trigger if canvas is broken.

Prisma returning unwanted count

Doing the query below the Prisma result returns a unwanted “count” property into likes object. We can see that the _count operator is not used anywhere.
I tried to change the count to false, but it keeps being returned. How can I disable this?

const user = await prisma.user.findUnique({
      where: {
        id: id
      },
      select: {
        id: true,
        username: true,
        posts: {
          omit: {
            userId: true,
          },
          include: {
            comments: {
              select: {
                id: true,
                user: {
                  select: {
                    id: true,
                    username: true,
                    profilePicture: true,
                  }
                },
                text: true
              }
            },
            likes: {
              select: {
                id: true,
                user: {
                  select: {
                    id: true,
                    username: true,
                    profilePicture: true,
                  }
                }
              }
            }
          }
        }
      }
    })

[
    {
        "id": "cm29icdzk0003ljs4nbmvor5u",
        "user": {
            "id": "cm29ibc6h0001ljs4gr73xl6q",
            "username": "caio"
        },
        "picture": "4cdd32cc-d2b3-4c26-9a1b-0f050ee7d48c",
        "comments": [
            {
                "id": "cm2bbusv200002s8r14mk3s20",
                "text": "abcn",
                "user": {
                    "id": "cm29ibc6h0001ljs4gr73xl6q",
                    "username": "caio",
                    "profilePicture": "764d4cec-79e0-4aef-a7b7-af1c2642e37f"
                }
            },
            {
                "id": "cm2bbvgwi00012s8rkkyvfgan",
                "text": "abcnn",
                "user": {
                    "id": "cm29ibc6h0001ljs4gr73xl6q",
                    "username": "caio",
                    "profilePicture": "764d4cec-79e0-4aef-a7b7-af1c2642e37f"
                }
            },
            {
                "id": "cm2bch34x00022s8rktrccf49",
                "text": "testandon",
                "user": {
                    "id": "cm29ibhas0002ljs4s50b4yoc",
                    "username": "maria",
                    "profilePicture": null
                }
            }
        ],
        "likes": {
            "users": [
                {
                    "id": "cm29ibc6h0001ljs4gr73xl6q",
                    "username": "caio",
                    "profilePicture": "764d4cec-79e0-4aef-a7b7-af1c2642e37f"
                },
                {
                    "id": "cm29ibhas0002ljs4s50b4yoc",
                    "username": "maria",
                    "profilePicture": null
                },
                {
                    "id": "cm29il7qe0004ljs4nujwiykh",
                    "username": "gerson",
                    "profilePicture": null
                }
            ],
            "count": 3
        }
    }
]

Trouble using require(); Needing to convert JS file to ES module

When I use require() in my JS file, I get the following error: File is a CommonJS module; it may be converted to an ES module.

Why is it so? And how can I use require, ie, convert my JS file into an ES module?

I have tried to append "type":"module" to my javascript file, and that didn’t help solve the problem.

I want to use require(). How can I do that?
Also, I am a bit of a newbie to JS so thank you for your patience.