JQuery Ajax Script working on Local Machine but not on Server
===

I've exhaustively looked through the internet to find a solution for this problem. <br>
So I have a jquery ajax script that loads in a csv file and generates some html code incorporating the data in the csv file. 

    	<script type="text/javascript">
		$(document).ready(function() {
		$.ajax({
		
		   type: "GET",
		   url: "database.csv",
		   dataType: "html",
		   data: {},
		   success: function(text) {
			   // Location of key information
			   var nameLoc;
			   var siteLoc;
			   var typeLoc;
			   var categoryLoc;
			   var descripLoc;
			   var canRequestLoc;
			   var EClassLoc;
			   var description='';
			   var temp = "Y";
			   var charTemp;
			   var site;
			   var len;
			   var fields = text.split(/\n/);
			   fields.pop(fields.length-1);
			   
			   var headers = fields[0].split(','), html = '<table align="center" id="searchData">';
			   
			   for(var i = 0; i < headers.length; i += 1) {
				  switch (headers[i]){
					case 'Name':
						nameLoc = i;
					 break;
					case 'RequestSystem':
						siteLoc = i;
					break;
					case 'Type':
						typeLoc = i;
					break;
					case 'Category':
						categoryLoc = i;
					break;
					case 'canRequest':
						canRequestLoc = i;
					break;
					case 'ECAPSClassification':
						EClassLoc = i;
					break;
					case 'Description':
						descripLoc = i;
					break;
				  };
			   }
			   descripLoc = canRequestLoc + 2;
			    
			   var data = fields.slice(1, fields.length);
			   
			   for(var j = 0; j < data.length; j += 1) {
				
				  var dataFields = data[j].split(',');
				  if (dataFields[nameLoc]==0){
					html += '</table>';
					$(html).appendTo('body');
					break;
				  };
				  
				  html += '<tr>';
				  html += '<td class="demo-show"> <h3>' + dataFields[nameLoc] +  '</h3>';
				  html += '<div class="menuBar"> ';
				  
				  charTemp = dataFields[canRequestLoc];
				  if (charTemp=='Y'){
				    switch (dataFields[siteLoc]){
						case 'Service Now':
							site = 'https://ccsn.service-now.com/';	
							break;
						case 'CCR IdM':
							site = 'http://idm.na.cokecce.com';	
							break;
						case 'ECAPS':
							site = 'https://ecaps.cokeccr.com/ecaps';	
							break;
						case 'KO IdM':
							site = 'https://apps.ko.com/idm';	
							break;
						default:
							site = 'default';	
							break;
					};
					html += '<a href="' + site + '">' + 'Request Access' + '</a><br>';
				  }
				  else{
					html += '<br><b> ' + dataFields[canRequestLoc+1] + '</b> <br> <br>';
				  };
				  html += '<b>Request System: </b>' + dataFields[siteLoc] + '<br>';
				  if (dataFields[siteLoc]=='ECAPS'){
					html += '<b>ECAPS Classification: </b>' + dataFields[EClassLoc] + '<br>';
				  };
				  html += '<b>Type: </b>' + dataFields[typeLoc] + '<br>';
				  html += '<b>Category: </b>' + dataFields[categoryLoc] + '<br>';
				  
				   html += '<b>Description: </b> ' ;
				  
				  for (var k=descripLoc; k<dataFields.length; k+=1){
					 html += dataFields[k];
				  }
				  
				   html += '<br><br></div>';
				  html += '</td> </tr>';
				  
			   }
			   html += '</table>';
			   $('.app').append(html);
		   }		
		});
	});
	</script>

So the script loads all the information perfectly but the part 

    html += '<td class="demo-show"> <h3>' + dataFields[nameLoc] +  '</h3>';
class="demo-show" is supposed to link this to another script where it makes the information between below the <h3> hidden. Like an accordion.

The script for that is (at different part of document):

    $(document).ready(function() {
        $('td.demo-show > div').hide();  
        $('td.demo-show > h3').click(function() {
            $(this).next().slideToggle('fast');
        });
    });

All of this works in my local machine but when I put it on the server the accordion script doesn't work which is weird because the exact same script is used in another part of the site and it works.

Only the part loaded by the JQuery Ajax part doesn't work.

I've tried everything!! This is my first time ever posting on a forum.
Please take a look and let me know what you think.