404 Not Found Route API

I’m facing an issue in my Next.js application where a POST request to /api/upload-pdf is returning a 404 Not Found error. The API route is defined in /app/api/upload-pdf/route.ts, following the Next.js App Router structure. Despite this, the request is not reaching the API, and the route does not seem to be recognized by the server.

I have checked the following:

  1. The API file exists at the correct path (/app/api/upload-pdf/route.ts).

  2. The fetch request is using the correct method (POST) and endpoint (/api/upload-pdf).

  3. The Next.js server has been restarted multiple times to apply any changes.

  4. There are no typos or casing issues in the file or folder names.

  5. The API is not being blocked by middleware or authentication rules.

  6. The POST method inside route.ts is correctly exported and implemented.

The request fails without even reaching the API route, suggesting that Next.js is not recognizing the route as valid. What could be causing this issue, and how can I debug it?

enter image description here

enter image description here

enter image description here

Spring Boot & Thymeleaf : FAQ Schema Markup to retrieve text dynamically from a Thymeleaf properties file

I created this script:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "[(${faq.question1})]",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "[(${faq.answer1})]"
    }
  }]
}
</script>

and in the property file:

faq.question1=What is Mystic Planets?
faq.answer1=Mystic Planets is an astrology app that helps users understand their birth chart and align with their purpose.

but the page does not load:

enter image description here

How to restrict hypen after 2 decimal points

I have this code which works fine for all positive/negative numbers with 2 decimal points. But its allowing hypen after 2 decimals.

How to restrict hypen after 2 decimals. Example -12.11---

<input type="text" id="numberInput">

$('#numberInput').on('input', function() {
    let value = $(this).val();
    // Replace any character that is not a digit, a minus sign or a dot.
    value = value.replace(/[^-d.]/g, '');
    // Ensure there is at most one minus sign at the beginning.
    value = value.replace(/^-?(0+|d+)/, function(match, group1) {
        if (group1 === '0') {
            return '-0'; 
        } else {
            return match;
        }
    });
    value = value.replace(/^-+/, '-');
    // Ensure there is at most one dot.
    value = value.replace(/(..*)./g, '$1');
    // Limit to two decimal places.
    value = value.replace(/(.d{2})d*/g, '$1');
    $(this).val(value);
  });

je n’arrive pas à récupéré mes post Instagram avec leur api

Bonjour,

J’essaie d’intégrer les publications de mon compte Instagram sur mon application, mais je rencontre des difficultés. J’ai réussi à récupérer celles de Facebook, mais pour Instagram, c’est une autre histoire… L’ancienne méthode avec l’API Basic Display est désormais dépréciée, et je ne parviens pas à trouver une solution qui fonctionne.

Auriez-vous un article, une documentation à jour ou toute autre ressource qui pourrait m’aider à avancer ?

Merci d’avance pour votre aide !

Art and Music Upload Stystem (PHP)

I have an art and music upload system using PHP. Now, the art system is working perfectly (when a user uploads art, that is inserted into the database, inserted in the admin page where I can approve or reject, etc). Each art also uploads in a directory file in the project called /uploads.

However, uploading music isn’t working. With the current code that I have, when I try to upload music, it displays this following error:

Warning: Undefined array key "file" in /Applications/MAMP/htdocs/skene/upload_process.php on line 39

Warning: Trying to access array offset on value of type null in /Applications/MAMP/htdocs/skene/upload_process.php on line 39
Invalid file type for music.

Here are my files.
upload.php:

<!-- Art Upload Form -->
    <div id="artUploadForm" class="upload-form">
        <form action="upload_process.php" method="POST" enctype="multipart/form-data">
            <div class="upload-container">
                <!-- Clickable Upload Box -->
                <div class="upload-box" onclick="document.getElementById('artFile').click();" id="artPreviewBox">
                    <input type="file" id="artFile" name="file" class="hidden" accept=".jpg,.jpeg,.png,.gif" required onchange="previewArt(event)">
                    <label for="artFile" class="upload-placeholder" id="artPlaceholder">+</label>
                </div>

                <!-- Form Inputs -->
                <div class="upload-details">
                    <h2>Upload Content</h2>
                    <p>Upload your artwork and describe its significance.</p>

                    <input type="hidden" name="upload_type" value="art">
                    <input type="text" name="artist_name" placeholder="Full Name" class="input-field" required>
                    <textarea name="description" placeholder="Artwork Description" class="input-field" required></textarea>

                    <select name="category" class="input-field" required>
                        <option value="" disabled selected>Select Category</option>
                        <option value="Painting">Painting</option>
                        <option value="Illustration">Illustration</option>
                        <option value="Photography">Photography</option>
                    </select>

                    <button type="submit" class="upload-btn">Upload Art</button>
                </div>
            </div>
        </form>
    </div>

    <!-- Music Upload Form -->
    <div id="musicUploadForm" class="upload-form hidden">
        <form action="upload_process.php" method="POST" enctype="multipart/form-data">
            <div class="upload-container">
                <!-- Clickable Upload Box -->
                <div class="upload-box" onclick="document.getElementById('musicFile').click();" id="musicPreviewBox">
                    <input type="file" id="musicFile" name="file" class="hidden" accept=".mp3,.wav,.ogg" required onchange="previewMusic(event)">
                    <label for="musicFile" class="upload-placeholder" id="musicPlaceholder">+</label>
                </div>

                <!-- Form Inputs -->
                <div class="upload-details">
                    <h2>Upload Content</h2>
                    <p>Upload your musical piece and describe its inspiration.</p>

                    <input type="hidden" name="upload_type" value="music">
                    <input type="text" name="artist_name" placeholder="Full Name" class="input-field" required>
                    <textarea name="description" placeholder="Music Description" class="input-field" required></textarea>

                    <select name="category" class="input-field" required>
                        <option value="" disabled selected>Select Genre</option>
                        <option value="Classical">Classical</option>
                        <option value="Jazz">Jazz</option>
                        <option value="Electronic">Electronic</option>
                        <option value="Rock">Rock</option>
                    </select>

                    <button type="submit" class="upload-btn">Upload Music</button>
                </div>
            </div>
        </form>
    </div>
</div>

upload_process.php:

<?php

// Database Connection
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "skene";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

if ($_SERVER["REQUEST_METHOD"] == "POST") {

    $artist_name = $_POST['artist_name'];
    $description = $_POST['description'];
    $category = $_POST['category'];
    $upload_type = $_POST['upload_type'];

    $target_dir = "uploads/";

    // Ensure the uploads directory exists (automatically creates it)
    if (!is_dir($target_dir)) {
        if (!mkdir($target_dir, 0777, true)) {
            die("Failed to create upload directory.");
        }
    }

    // Check if directory is writable
    if (!is_writable($target_dir)) {
        die("Error: Upload directory is not writable. Check permissions.");
    }

    // Generate unique filename
    $file_name = basename($_FILES["file"]["name"]);
    $target_file = $target_dir . time() . "_" . $file_name;
    $file_type = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));

    // Allowed file types
    $allowed_art = ["jpg", "jpeg", "png", "gif"];
    $allowed_music = ["mp3", "wav", "ogg"];

    if ($upload_type == "art" && !in_array($file_type, $allowed_art)) {
        die("Invalid file type for artwork.");
    }
    if ($upload_type == "music" && !in_array($file_type, $allowed_music)) {
        die("Invalid file type for music.");
    }

    // Move uploaded file
    if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
        $stmt = $conn->prepare("INSERT INTO creators_uploads (type, artist_name, description, category, file_path, status) VALUES (?, ?, ?, ?, ?, 'pending')");
        $stmt->bind_param("sssss", $upload_type, $artist_name, $description, $category, $target_file);

        if ($stmt->execute()) {
            echo "Upload successful! Awaiting admin approval.";
        } else {
            echo "Database error: " . $stmt->error;
        }

        $stmt->close();
    } else {
        echo "Error: Unable to upload file.";
    }

    $conn->close();
}
?>

P.S. My Javascript Functions (if necessary):

        // Function to preview uploaded artwork
    function previewArt(event) {
        let file = event.target.files[0];
        if (file) {
            let reader = new FileReader();
            reader.onload = function(e) {
                let previewBox = document.getElementById("artPreviewBox");
                previewBox.style.backgroundImage = "url('" + e.target.result + "')";
                previewBox.style.backgroundSize = "cover";
                previewBox.style.backgroundPosition = "center";
                previewBox.style.border = "2px solid black";
                previewBox.style.borderRadius = "5px";

                // Hide placeholder
                document.getElementById("artPlaceholder").style.display = "none";
            };
            reader.readAsDataURL(file);
        }
    }

    // Function to preview uploaded music
    function previewMusic(event) {
        let file = event.target.files[0];
        if (file) {
            let reader = new FileReader();
            reader.onload = function(e) {
                let previewBox = document.getElementById("musicPreviewBox");
                previewBox.innerHTML = `
                    <audio controls>
                        <source src="${e.target.result}" type="${file.type}">
                        Your browser does not support the audio element.
                    </audio>
                `;
                previewBox.style.border = "2px solid black";
                previewBox.style.borderRadius = "5px";

                // Hide placeholder
                document.getElementById("musicPlaceholder").style.display = "none";
            };
            reader.readAsDataURL(file);
        }
    }

</script>

Nuxt – How to load data in SSR in a pinia store?

I’m trying to create a pinia store that load data in SSR. How to load data in SSR in a pinia store ? Is that possible ?

I’d like to be able to do something like this in every component where i’ll need the data :

const myStore = useMyStore();
myStore.fetchItems();

And this is my store :

import { defineStore } from 'pinia';

export const useMyStore = defineStore('myStore', {
  state: () => ({
    items: ref([]),
    loading: ref(false),
    error: ref(null)
  }),

  actions: {
    async fetchItems() {
        if (this.items?.length > 0) {
          return;
        }

        this.loading = true;

        const { $appConfig } = useNuxtApp();
        const apiUrl = $appConfig.api?.url;

        try {
            const data = await $fetch(`${apiUrl}/reference-data/airports/`);
            this.items = data;
        } catch (err) {
            this.error = err;
        } finally {
            this.loading = false;
        }
    }
  },

  persist: {
    storage: piniaPluginPersistedstate.sessionStorage()
  }
});

For now, i see the api call in network tab on first load, but when i try to refresh, i get in the console :

Hydration completed but contains mismatches.

Why is that ? What’s the best way to load data that will be accross the app in SSR ?

Trying to send a signalR message to a specific logged in user

BACKGROUND: I have set-up a session cookie management implementation in my ASP.NET Core 8.0 web application, the authentication is cookie based.
When I login to the application first time, the JWT is extracted and httponly cookie is set up for the application,then I fetch the token expiry time and send it to my SignalR hub from my controller ( included screenshot), the listener is setup in my frontend implementation ( I have used javascript for this and the code is tightly coupled to my web app, no need of CORS )

ISSUE: When i use the

await _hubContext.Clients.Group($"user_{loginResponseDto.User.Id}").SendAsync("SessionExpiryTime", tokenExpiry);

OR

await _hubContext.Clients.User(loginResponseDto.User.Id).SendAsync("SessionExpiryTime", tokenExpiry);

the messages are NOT available on my JS, the hub connection is open and listening, without any errors or exceptions thrown. Only when I use

await _hubContext.Clients.All.SendAsync("SessionExpiryTime", tokenExpiry);

the events are available and the implementation works as expected.

My Login method inside the Auth Controller, LN 71 where i trigger the signalR event

My SignalR hub class

Program.cs

SignalR mapping

IUserIdProvider Interface

EXPECTATION: I want to setup the SignalR expiry time refresh message only for the particular user who is logged in, I have tried to make this implementation work by using the userId and connectionId, but unfortunately other than Clients.All.SendAsync nothing has worked for me so far.

I haven’t been able to exactly pinpoint why my messages are not going across when I use Clients.User OR Clients.Group. I have tried numerous Youtube videos and Microsoft SignalR docs and implementations but to no luck. Also, let me know if this is some implementation error from my end, or what I have done here is wrong.

Please let me know if repo access is required to take a look at this issue, or anything else I can assist with to troubleshoot this.

Django model formset to update objects with user input

Having some troubles with understanding objects update using model formset.
Creation of objects is not a problem as flow is clear. Updating predefined objects is not a problem as well as we use instance to pass instances.
However the question is : How to update objects which user inputs in model formset fields?

Let’s say I have some dummy code:

models:

class Product(models.Model):
    serial_number = Charfield()
    config = ForeignKey(Configuration)

class Configuration(models.Model):
    items = ManyToMany(Item)

forms:

class ProductFormset(forms.BaseModelFormSet):
    def __init__(self, *args, **kwargs):
        super(ProductFormset, self).__init__(*args, **kwargs)

        self.queryset = models.Product.objects.none()


class ProductForm(forms.ModelForm):
    class Meta:
        model = Product
        fields = ["serial_number"]

ProductFormSet = modelformset_factory(Product, ProductForm, ProductFormset, min=1, extra=0)

So whenever user inputs some serial_number(s) on creation page I’m able to use clean_data to process new objects and save(). Whenever I use object’s DetailView to redirect to update link I’m able to pass object id and use it to assign as instance and all works fine for save().
But on update page I want to let user decide which products to edit. So until form submitted the serial_number(s) are unknown and can’t be used as initial. Formset is_valid() returns False as well as field error risen Object already exists.
I’m also using JS to dynamically add new forms utilizing formset.empty_form.
Currently I switched to normal Formset but it feels wrong as I have to do all validations manually (for example checks if object exists in DB).
What I’m missing?

stop DIV from resizing and ensure SVG fills space

I have a grid layout that scales in size in the main content area of a page. which works well enough, currenly its set to 30×30 cells just for testing though this will change depending on page settings. My CSS for this is:

#gameBoard {
  height: 100%;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  background: #101020;
  grid-template: repeat(30, 1fr) / repeat(30, 1fr);
  padding: 0;
}

#gameBoard .mscell {
  cursor: pointer;
  position: relative;
  background-color: #d1d1d1;
  border-width: 3px;
  border-style: solid;
  border-color: white #9e9e9e #9e9e9e white;
}

#gameBoard .mscell:hover {
  background-color: #eaeaea;
}

#gameBoard .mscell.revealed {
  cursor: pointer;
  position: relative;
  background-color: #cacaca;
  border: 1px solid #aeaeae;
}

#gameBoard .mscell.boom {
  background-color: red;
}

#gameBoard .mscell svg {
  border: 0;
  padding: 0;
  margin: 0;
  /* width: 100%;
  height: 100%; */
}

My problem is that I want to add content to certain cells like a color coded number or an image and have this number scale to the size of the cell (which will vary both with page setting and browser window size)… and figured the most simple way to do this would be with SVG… Though at this point I am very open to other options!

I created a file for the SVG numbers:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <symbol id="num_1" viewBox="0 0 24 24" fill="none">
    <path d="M12 20V4L9 7" stroke="#292929" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_2" viewBox="0 0 24 24" fill="none">
    <path d="M8 8C8 6.97631 8.39052 5.95262 9.17157 5.17157C10.7337 3.60947 13.2663 3.60947 14.8284 5.17157C16.3905 6.73366 16.3905 9.26632 14.8284 10.8284L9.17157 16.4853C8.42143 17.2354 8 18.2528 8 19.3137L8 20L16 20" stroke="#292929" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_3" viewBox="0 0 24 24" fill="none">
    <path d="M8 19.0004C8.83566 19.6281 9.87439 20 11 20C13.7614 20 16 17.7614 16 15C16 12.2386 13.7614 10 11 10L16 4H8" stroke="#292929" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_4" viewBox="0 0 24 24" fill="none">
    <path d="M10 4L8.47845 11.6078C8.23093 12.8453 9.17752 14 10.4396 14H16M16 14V8M16 14V20" stroke="#292929" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_5" viewBox="0 0 24 24" fill="none">
    <path d="M8 19.0004C8.83566 19.6281 9.87439 20 11 20C13.7614 20 16 17.7614 16 15C16 12.2386 13.7614 10 11 10C9.87439 10 8.83566 10.3719 8 10.9996L9 4H16" stroke="#292929" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_6" viewBox="0 0 24 24" fill="none">
    <path d="M13 4L7.77313 12.3279M17 15C17 17.7614 14.7614 20 12 20C9.23858 20 7 17.7614 7 15C7 12.2386 9.23858 10 12 10C14.7614 10 17 12.2386 17 15Z" stroke="#292929" stroke-width="2.5" stroke-linecap="round"/>
  </symbol>

  <symbol id="num_7" viewBox="0 0 24 24" fill="none">
    <path d="M8 4H16L10 20" stroke="#292929" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_8" viewBox="0 0 24 24" fill="none">
    <circle cx="12" cy="15" r="5" stroke="#292929" stroke-width="2.5" stroke-linejoin="round"/>
    <circle cx="12" cy="7" r="3" stroke="#292929" stroke-width="2.5" stroke-linejoin="round"/>
  </symbol>

  <symbol id="num_9" viewBox="0 0 24 24" fill="none">
    <path d="M11 20L16.2269 11.6721M7 9C7 6.23858 9.23858 4 12 4C14.7614 4 17 6.23858 17 9C17 11.7614 14.7614 14 12 14C9.23858 14 7 11.7614 7 9Z" stroke="#292929" stroke-width="2.5" stroke-linecap="round"/>
  </symbol>

  <symbol id="num_0" viewBox="0 0 24 24" fill="none">
    <path d="M12 20C14.7614 20 17 17.7614 17 15V9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9V15C7 17.7614 9.23858 20 12 20Z" stroke="#292929" stroke-width="2.5" stroke-linejoin="round"/>
  </symbol>
</svg>

…and am writing them into the appropriate cell as needed with:

c.innerHTML=`<svg class="msNum"><use href="/img/icons.svg#num_${cv}"></use></svg>`

I tried doing this with width & height set in css for the svg to 100% and for some reason the cells and and any svg they contain size to 300x300px… which is a size that doesn’t seem to relate to anything else, with the nested use element redering at 37.5×200 for number one.

Removing the width and height from css, the cells still resize to 300×300, but with the svg sized at 300×150 with the image rendered half size at the same aspect ratio, the use element now sizes to 18.75×100 according to the dev console.

On the other hand if I set the height and width of the SVG in my script, effectively hardcoding it (I chose 13 here just because my cells were rendering just over 13px square) using:

c.innerHTML=`<svg class="msNum" width="13" height="13"><use href="/img/icons.svg#num_${cv}"></use></svg>`

Then the cells again resize after content is added changing from approx 16.16×16.16 to 16.16×24, gaining height even though the svg is sized at 13×13 according to the console with no border, margin or padding, centered vertically in the cell. So the grid cells get taller even though the content is smaller! (This changes to the grid cells becoming 24×29 with the svg sized to 22×27 if I reintroduce the 100% height and width sizing in the css…)

So basically I am making a total mess of it… and something odd is happening with the sizing I don’t understand.

How can I get the SVG to scale to 100% of the cell (or smaller and centered) size without changing the size of the cell and without hardcoding all the sizes? I do really want to avoid hardcoding the sizes, to keep the grid as large as possible in whatever browser window.

`encodeURIComponent` behaving weirdly on `window.location.href`

I have a JavaScript snippet running on browsers. It sends the URL of the current tab as a parameter over network:

var winUrl = window.location.href;
var callUrl = `https://my.domain.com/?url=${encodeURIComponent(winUrl)}`;
send(callUrl);

However, occasionally, I’m receiving malformed URLs in my server, mostly in the forms of

"https://my.domain.com/?url=https:%2F%2Fwww.google.com" // colon (:) not encoded. Expected https%3A%2F%2Fwww.google.com
"https://my.domain.com/?url=https:/google.com" // not encoded at all and with a single slash (/). Expected https%3A%2F%2Fwww.google.com

This doesn’t make sense to me as I’m calling encodeURIComponent on the whole URL.

As this is a quite rare case, I was suspecting some Browser plugins on some clients might override encodeURIComponent for some reason, or some websites that include my snippet modify window.location.href in a wrong way.

My questions are:

  • Is this a legitimate suspicion?
  • How is it possible to end up with these URLs after encodeURIComponent(window.location.href)?
  • If encodeURIComponent has been changed, can I find the original somewhere else?
  • If window.location.href is touched and is set to a bad url, will it remain the same even though the browser might “fix” it itself for navigation?

Trigger a UpdatePanel in a different project [closed]

I have a to display an image dynamically based on the value selected from a dropdown.
The code for displaying the image is inside _layout.cshtml.

_layout.cshtml and the code of the dropdown are inside two different projects. I have tried using viewbag and tempdata but since the two files are in two different projects, so the value doesn’t get passed. I am wondering, if there is a way to pass on a value from one project to to another?

As the value will be selected from a dropdown, so i cannot use a hard-coded value in any of the .config files. I am using framework 4.7.2

Thank you.

How to Extract Code Blocks from Different Tabs in a Code Documentation Using Crawl4AI (or any other tool)?

I’m trying to scrape code blocks from multiple tabs in a documentation page using Crawl4AI. While I’m able to extract Markdown content, the code blocks inside tabbed sections are not being captured.

Issue:

  • Some documentation sites have tabbed code snippets (e.g., “Python”, “Java”, “JavaScript”), and only one tab is visible at a time. Used Page Interaction from Crawl4AI.
  • Crawl4AI is scraping only the default visible tab, missing other language tabs.

enter image description here

What I’ve Tried:

  • Tried running JavaScript to click each tab to dynamically loaded content.
  • Standard Page Load: Extracted in markdown.

What I Need:

  • A generic and dynamic solution since I need to scrape 100+ URLs across different documentation sites.
  • A way to extract all tabbed code blocks from each page, regardless of which tab is visible by default.
  • A method to ensure JavaScript-rendered content loads fully before extraction.

Task :app:safedkAdjustInputsRelease FAILED

Task :app:safedkAdjustInputsRelease FAILED
Execution failed for task ‘:app:safedkAdjustInputsRelease’.
Could not find method getDexFolders() for arguments [] on task ‘:app:buildReleasePreBundle’ of type com.android.build.gradle.internal.tasks.PerModuleBundleTask.

satellizer.js login with Instagram – error popup

For a few days, authentication towards Instagram using the classic API “https://api.instagram.com/oauth/authorize” no longer works. Unfortunately when I request the “code” the Instagram popup that opens sends an error to the javascript, which intercepts it as already closed. But in reality it’s not true, as if the reference is lost.

$auth
                .authenticate(provider)
                .then((resp) => {
                    resolve(resp);
                })
                .catch((err) => {
                    const errorMessage = `swSocialSDK: ${provider} - ${phase} -${err.message || err.errorMessage || 'unknown message description'}`;
                    api.errorReport('socialConnect', errorMessage);
                    reject(err);
                });

This is the error in devtools in chrome:

connectSocialErrorHandler Error: The popup window was closed
        at eval (satellizer.js:559:1)
        at callback (angular.js:12908:1)
        at Scope.$eval (angular.js:17994:1)
        at Scope.$digest (angular.js:17808:1)
        at Scope.$apply (angular.js:18102:1)
        at tick (angular.js:12898:1) {id: null, name: 'instagram', linked: false, enabled: true, active: true, …}

Someone has an idea?

How do I stop Joomla 5 messing with my Javascript?

I want to use the following Javascript to fetch a video URL. It works fine in a raw HTML page, but within an article in Joomla 5 the URL always has the local URL prepended.

<script>
  
  function loadVideo(videoUrl, videoTitle) {
    const videoDisplay = document.querySelector('.video-display'); // Get the video-display div
    videoDisplay.innerHTML = ''; // Clear any previous content

    const videoPlayer = `
      <h3>${videoTitle}</h3>
      <video width="100%" height="auto" controls autoplay>
        <source src="${videoUrl}" type="video/mp4">
      </video>
    `;
    
    videoDisplay.innerHTML = videoPlayer; // Inject the video player into the video-display div
  }
</script>

On inspecting the output HTML, the line <source src="${videoUrl}" type="video/mp4"> has been changed to <source src="/${videoUrl}" type="video/mp4"> which has the effect of prepending the local URL to the video URL. Can I stop this behaviour?

Thanks.