Chrome debugger breaks outside of breakpoints and seems confused about browsing hitting the wrong pages
When I try to run the debugger in chrome, it doesn't stop at the marked lines (122 and 123). I sometimes see a red errormarker appear a second, but not long enough to see what it says. I don't usually see any alert pop up (It just the contents of a window, which I assume must be standard). But sometimes I do, as you can see from the lower of the two images. I've looked at all the files I have in the project, and there doesn't seem to any text breakpoints anywhere and I cannot find any in the Chrome debugger.
I've been searching for a solution for long time and haven't really found anything substantial. I have however found this on https://bytes.com/topic/javascript/answers/583677-javascript-embedded-objects-unload-event
It looks like you are seeing the 'in-memory' caching of previously viewed web pages. That is generally a good idea as it allows for the back button to operate very quickly. However, if the page includes an onuload handler (frequently necessitated by IE's memory leak problems), and that handler is executed when the page is navigated away from, then the page in memory will be in an 'unloaded' state that will not necessarily be appropriate for re-display as it is. So a reasonable strategy would be to only store a page in memory for re-disarray on the use of the back button if it did not have an onuload (and probably onload) handler, and when the page did have such handlers it would make more sense to re-load the page (from the browser's cache or from the network) so that it could go into its loaded state as it normally would.
Richard. Jan 4 '07 #2
I don't know what Richard is talking about here, but it looks a lot like what I am experiencing. I first show a Select-page, where the user can select what he wants to edit. I then show an edit page, where the user can edit the selected data. When the user then clicks a Save-button, the edit-page sends the data to another page using XMLHttpRequest, and the third page, the SavePage, saves the data in the database. I then want to return to the page before the edit-page, the Select-page. But what sometimes happens is that I stay in the edit page. Sometimes with the last entered data, sometimes with the data entered before the Save-button was clicked. Either one of the two datasets are shown, either the latest or the one just before that. If I then press the Save-button again, it will show the other set and so on. As if it is cycling between the to set. If I keep pressing the button, it will sometimes return to the Select page. Sometimes with the old dataset, sometimes with the new one.
Very much like what Richard describes, at least in some ways. But Richards comment is dated Jan 4 '07, about 16 years or so, older than Chrome and should be fixed years ago. I at least haven't heard about it.
I also experience the bit where the debugger doesn't seem to catch the breakpoints, so I tend to think of this as some kind of memory problem, some DOM structure or History gone bad, but what is it? Next thing I will try it on some other browsers, which off course will not solve the problem as such, but might point me in the right direction.
I must admit I am bit baffled here. I have tried a lot, but I was hoping someone more experienced out there might know the answer to this or have some suggestions.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/dXslVyi

Comments
Post a Comment