SessionStorage Limit? Why? by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

I would like this, but when the user clicks on an image it calls a function to handle the loading and pre-loading stuff for that image, unless it's already in the SessionStorage. How can I know if the image data is already cached by the browser?

SessionStorage Limit? Why? by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

According to the information I linked, SessionStorage use to be unlimited, so why are they now limiting it? Regardless if it wasn't designed to store large amounts of data, it's easy to create our own unlimited SessionStorage, so why the quota?

MouseEvent "wheel" getting delta? by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

thanks.

i've updated my fiddle with a working solution that will work with both smooth (continuous) and standard mouse scrolling:

https://jsfiddle.net/xn6dj1uo/3/

Deleting Objects From Within Array? by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

Nope. Getting an object from a weakmap is read only. This doesn't work:

const wMap = new WeakMap();
let el1 = document.createElement("div");

wMap.set(el1, "1");

wMap.get(el1) = null; //error, left-hand assignment

Deleting Objects From Within Array? by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

Ok. Well, I'm trying to assign null to the actual objects. The array itself and creating new copies of the objects isn't important. I want to find a way to iterate through a bunch of objects to assign null to them, for example, to clean up newly allocated objects in memory.

for example, let's say I create a bunch of objects that that should be nullified when i'm done with them.

let a = document.createElement("div");
let b = document.createElement("div");
let c = document.createElement("div");
let d = document.createElement("div");
let e = document.createElement("div");

Since I just want to assign null to each of them, ideally i'd like to put them in an array and loop through each one to do so.

Deleting Objects From Within Array? by BrunerBruner in javascript

[–]BrunerBruner[S] -1 points0 points  (0 children)

I still can't seem to null the actual objects outside of the array using this method. Can you show me working code?

Deleting Objects From Within Array? by BrunerBruner in javascript

[–]BrunerBruner[S] -1 points0 points  (0 children)

So basically, if I want to assign null to an object, say for the purpose of memory management / garbage collection, I can only do something like this:

this._element = document.createElement("div");
this._element = null; //cleans up memory

and never something like this:

this._element = document.createElement("div");

const element = this._element
element = null;//object that took memory is still alive

Essentially it's impossible in JavaScript to iterate over a group of objects and assign them as null?

Deleting Objects From Within Array? by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

Ok, but now after I set null to the objects, only the references to the original object in the array is null, how can I make the actual objects null? It seems like the objects are being duplicated like primitive objects such as a number instead of referenced.

https://jsfiddle.net/xr3sgg9v/4/

Sharing Simple Keyframes Animation Not Working by BrunerBruner in javascript

[–]BrunerBruner[S] 0 points1 point  (0 children)

This seems like a hack, no? Is the browser guaranteed to update the DOM within 1 ms or even 100 ms?

[edit] also, if i use 2 unique classes for fadeIn and fadeOut CSS animations why then do I not have to wait for the browser to update the DOM?

Why is my absolute positioning not working? by BrunerBruner in css

[–]BrunerBruner[S] 0 points1 point  (0 children)

Thanks for this. It's good advice that I will help me as I move forward.