[removed] Changing src-attribute of a embed-tag

后端 未结 6 1243
失恋的感觉
失恋的感觉 2020-11-27 07:27

I have the following scenario.

I show the user some audio files from the server. The user clicks on one, then onFileSelected is eventually executed with both the sel

6条回答
  •  再見小時候
    2020-11-27 08:16

    I was also facing same issue when I want to change "src"-attribute of "embed" element, so what I did, is given below:

    var parent = $('embed#audio_file').parent();
    var newElement = "";
    
    $('embed#audio_file').remove();
    parent.append(newElement);
    

    And this will work fine in my application.

    Conclusion: - You need to first remove the embed element and then you have to reinsert it with change in src.

提交回复
热议问题