# JavaScript Addressbook modifiction: fine locally but error on ec2

**URL:** https://community.dreamfactory.com/t/javascript-addressbook-modifiction-fine-locally-but-error-on-ec2/2471
**Category:** Code Examples
**Created:** [April 4, 2016, 12:40am UTC](https://community.dreamfactory.com/t/javascript-addressbook-modifiction-fine-locally-but-error-on-ec2/2471 "2016-04-04T00:40:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thallstein](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thallstein](https://community.dreamfactory.com/u/thallstein)
#### Post date: [April 4, 2016, 12:40am UTC](https://community.dreamfactory.com/t/javascript-addressbook-modifiction-fine-locally-but-error-on-ec2/2471/1 "2016-04-04T00:40:11Z")

</div>

I added a few minor modifications to test out functionality & the changes work locally but not on the server. When run locally I click my testing button to execute a block of code and it executes and returns table data. When I make the same changes to the same files on the server I get a resource not found error.

Changes made:

Added button to index.html

 TZ Test

Added event handler registration and table lookup to end of script.js

//TZ Testing Section

$(’#tztest’).on(‘click’, function () {  
console.log(“tztest…”);  
showContactsPlusGroups();  
});

var cg\_params = ‘related=contact\_by\_contact\_id, contact\_group\_by\_contact\_group\_id’;  
function showContactsPlusGroups() { $.api.getRecords(‘contact\_group\_relationship’, cg\_params, getToken(‘token’), populateContactsPlusGroupsTable); }

var populateContactsPlusGroupsTable = function(data\_) {  
// var table = $(’#table\_01’).DataTable();  
var contactsWithGroups = [];

```
$.each( data_, function (id_, value_) {
    contactsWithGroups.push( [
        value_.contact_by_contact_id.first_name + " " + value_.contact_by_contact_id.last_name,
        value_.contact_group_by_contact_group_id.name
        ]);
} ); 

$.each( contactsWithGroups, function(id_, value_ ) {
    console.log( value_[0] + "|" + value_[1] );
});

```

// $(’#table\_01’).DataTable().clear().rows.add(contactsWithGroups).columns.adjust().draw();  
};

$(document).ready(function() {  
window.alert(“tz version”);  
}  
);

---

<div class="post-metadata">

### Author: ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)
#### Post date: [April 4, 2016, 1:44pm UTC](https://community.dreamfactory.com/t/javascript-addressbook-modifiction-fine-locally-but-error-on-ec2/2471/2 "2016-04-04T13:44:05Z")

</div>

can you post the full error

---

<div class="post-metadata">

### Author: ![thallstein](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thallstein](https://community.dreamfactory.com/u/thallstein)
#### Post date: [April 4, 2016, 6:07pm UTC](https://community.dreamfactory.com/t/javascript-addressbook-modifiction-fine-locally-but-error-on-ec2/2471/3 "2016-04-04T18:07:06Z")

</div>

I cleared the browser history and the app works fine now. I’m going to delete / close this post. Trevor
