var url = $(location).attr('hostname'); var folder_path = window.location.pathname.split('/').slice(0, 2).join('/'); var __SERVER_URL__ = 'http://'+url+folder_path+'/';