Solution:
Replace the line of code var url_id_value = url_id.split('#')[1]; with the following:
var url_id_value = url_id.split('#')[1];
var url_id_value = url_id.substr(0, url_id.lastIndexOf("/") + 1);