Loading and executing .js audio on a jQueryMobile AJAX page loading

I have a page that displays through jQuery Mobile that has an audio.js player on it.

However, when the page is loaded using jQuery Mobile AJAX with the capture of a click handler, then the audio.js code does not execute, so there is no audio player.

Is there a way I can get Javascript code, for example, audio.js code, to execute when pages load via AJAX?

You can see an example of the problem by going to http://media.urbansermons.net/m/audio-list/term/6711 and then clicking on any of the audio files listed there. Please note that this is a test site.

+4
source share
1 answer

Since the user needs to click an item, if instead of loading a new link in the browser, you switched from the list to the details page using the DIV, so as not to open a new URL, you can use the same click to start the player (as mobile devices make necessary so that the click event precedes audio / video playback.

Also, by the link you sent, all mp3s are returned as empty files.

+1
source

Source: https://habr.com/ru/post/1468835/


All Articles