• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

imageUpload in movieclip

Engaged ,
Apr 11, 2021 Apr 11, 2021

Copy link to clipboard

Copied

where is the problem Attached file for my project

 

https://drive.google.com/file/d/1wFPRy-hXRpoHvqFV9CtCQFfjlcfn5M4a/view?usp=sharing

 

    // Grabbing Elements and Storing in Variables
const defaultFile = document.getElementById("default-file");
const customBtn = document.getElementById("custom-btn");
const customSpace = document.getElementById("custom-space");


this.customBtn.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler() {
    this.defaultFile();
}


this.defaultFile.addEventListener("change", defaultFile1.bind(this));
function defaultFile1() {
    if (defaultFile.value) {
        customSpace.innerHTML =
            this.defaultFile.value.match(/[\/\\]([\w\d\s\.\-\(\)]+)$/)[1];
    } else {
        this.customSpace.innerHTML = "No File, Selected!";
    }

    const files = defaultFile.files[0];


    if (files) {
        const fileReader = new FileReader();
}

    this.fileReader.addEventListener("load", function () {
        this.preview_img.setAttribute("src", this.result);
        this.console.log(this.result);
    });
    this.fileReader.readAsDataURL(files);
}

 

TOPICS
Code , Timeline

Views

237

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2021 Apr 11, 2021

Copy link to clipboard

Copied

have you created those elements (with js code or by adding to the html document)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

@kglad adding to the html document ? why ?

Can you help me, genius?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

You can actually stop having the js code published within the html file and have the js generated separately. You can also change the code in the html file,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

I know
All of them have the same purpose
But I was amazed why he asked this question?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2021 Apr 30, 2021

Copy link to clipboard

Copied

LATEST

i asked because the first 3 lines of your code make no sense unless you'd done one of the two.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines