Hi Lim,
It's not good way to refresh all chat page.
You just need to update needed data.
For example in Appery.io you can do it with invoking datasource which will update your messages.
Also if after these facts you still want to update the page you can use following code:
Common way:
pre
window.location.reload();
/pre
JQM specific:
pre
//Note you should replace "Screen20" with page name you need to reload.
Apperyio.navigateTo("Screen20", {reloadPage: true, transition: 'none'})/pre
Regards.