M
M
Messi2018-03-16 14:59:03
JavaScript
Messi, 2018-03-16 14:59:03

Why doesn't it work in Firefox?

var link = document.createElement('a');
            link.href = self.attr('href');
            link.download = 1; 
До этого пункта все отлично работает, получаю ссылку:
<a href="https://domain/source/1/4VdU88Fl9F4qSbGDDXVEVF_Il4W2ns1M.jpg" download="1"></a>
и хочу чтобы автоматически кликало по ней, для этого ниже click()
            link.click(); 
Но работает click только в хроме. Почему?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2018-03-16
@FitTech

The element is not integrated into the document's dom structure and should not work. Use append\before and other jquery methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question