I have a system where I store url files in each row in my mysql database. I want to use this data to put it into an array and use it in a javascript function. For example:
var files_list = "https://example.com/file1.docx,https://example.com/file2.docx,https://example.com/file3.docx,"; //value obtained via ajax
var links = [files_list];
This shows error, so how can I separate each url and get from this:
var links = ["https://example.com/file1.docx,https://example.com/file2.docx,https://example.com/file3.docx,"];
To this:
var links = ["https://example.com/file1.docx","https://example.com/file2.docx","https://example.com/file3.docx",];
I would like some help.