I have an id "content", it contains many Google Drive URLs of images. So, I have math all URLs and replace it with clickable link.
But I can not display it likes a nother images.
Here is my code
$(document).ready(function(){
function replace_content(content)
{
var exp_match = /(\b(https?|):\/\/drive\.google\.com\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;;
var element_content=content.replace(exp_match, "<a href='$1'>$1</a>");
return element_content;
}
var content = $('#content').html();
$('#content').html(replace_content(content));
I can not cut image id from each URL found. Who can help me?
I hope my question will be answered. Auto display all image hosted in Google Drive in the id "content"