Web page stops responding error

Web page stops responding error

sarthaks21sarthaks21 Posts: 37Questions: 7Answers: 0

Hey!
I've made a project using datatables. There is no issue with datatables as such but the data source of table is from a json file which I read using

var data_array = $.ajax({
     type: 'GET',
     url: 'static/tableviewer/ajax/table_contents.json',
     async: true,
     dataType: 'json',
 });

I've made a setInterval function which updated the data_array with new data and the table is updated accordingly.

Often times, the page freezes and page unresponsive error is faced with an option to wait or kill page is encountered. Have to close the tab and re open the page to fix this.
Anyone have any idea what might be causing this?

Answers

  • colincolin Posts: 9,822Questions: 0Answers: 1,629

    That ajax call or DataTables shouldn't cause that. It would be worth trying it in private browsing mode, to see if an extension is causing the problem. Have you found a pattern to the lockups?

    Colin

  • sarthaks21sarthaks21 Posts: 37Questions: 7Answers: 0

    Earlier it used to happen because the interaction(mouse click, keyboard press and stuff) used to happen when file read part was happening. I added the exception handling to avoid getting the alert from datatable

      $.fn.dataTable.ext.errMode = 'none';
    

    Using this. This was resolved.
    Now, when I keep the page open for some time(2-3 hrs usually or sometimes even less than that) , I am not able to interact with the page, it sort of freezes. When I refresh I get the page unresponsive error.

  • kthorngrenkthorngren Posts: 10,638Questions: 25Answers: 2,428

    I do this type of thing all the time without issue. Your code is doing something that is causing some sort of memory leak. Look for things like adding event handlers without clearing them first or reinitializing something without first properly destroying it.

    Kevin

  • sarthaks21sarthaks21 Posts: 37Questions: 7Answers: 0

    Hey is there any way I can share snippets of my code with you? A private message kind of thing?

Sign In or Register to comment.