Skip to main content

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.

enter image description here

enter image description here

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

Popular posts from this blog

Where and how is this Laravel kernel constructor called? [closed]

Where and how is this Laravel kernel constructor called? public fucntion __construct(Application $app, $Router $roouter) { } I have read the documentation and some online tutorial but I can find any clear explanation. I am learning Laravel and I am wondering where does this kernel constructor receives its arguments from. "POSTMOTERM" CLARIFICATION: Here is more clarity.I have checked the boostrap/app.php and it is only used for boostrapping the interfaces into the container class. What is not clear to me is where and how the Kernel class is instatiated and the arguments passed to the object calling the constructor.Something similar to; obj = new kernel(arg1,arg2) or, is the framework using some magic functions somewhere? Special gratitude to those who burn their eyeballs and brain cells on this trivia before it goes into a full blown menopause alias "MARKED AS DUPLICATE". To some of the itchy-finger keyboard warriors, a.k.a The mods,because I believe in th...

Why is my reports service not connecting?

I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...

How to show number of registered users in Laravel based on usertype?

i'm trying to display data from the database in the admin dashboard i used this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); echo $users; ?> and i have successfully get the correct data from the database but what if i want to display a specific data for example in this user table there is "usertype" that specify if the user is normal user or admin i want to user the same code above but to display a specific usertype i tried this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count()->WHERE usertype =admin; echo $users; ?> but it didn't work, what am i doing wrong? source https://stackoverflow.com/questions/68199726/how-to-show-number-of-registered-users-in-laravel-based-on-usertype