jeudi 3 septembre 2020

Trying to add a "/" after variable in JS (for iframe url), but not working

So I'm working on a website, and basically, the user inputs a code into the textbox. An iframe then navigates to www.url.com/CODE/. However, for some reason, the Iframe is only navigating to www.url.com/CODE (no backslash at the end), which throws a 404 error. Here is the code, which clearly adds a "/" at the end - is something wrong with the code?

inputs[0].addEventListener("change", () => {
  iframes[0].src = predefined_url + "/" + inputs[0].value + "/";
  inputs[0].value = "";
});



Aucun commentaire:

Enregistrer un commentaire