3 ms·
>What do you do if you create a website which modifies the dom, but find out what your users have extension XYZ which completely breaks are our assumptions abou
by na85 11y ago
>What do you do if you create a website which modifies the dom, but find out what your users have extension XYZ which completely breaks are our assumptions about what the dom is? For example you just received a server-rendered page which should have "ul/li/span.Foo", but find out that the span is a link now instead, so your JS breaks down.
Perhaps you should move away from the "just throw some js at it" mentality and learn to design things in a more robust fashion, so that they don't depend on having to make assumptions about the dom.
- viraptor 11y agoReality test - can you show me a single website which has rich client-side script, gets html or json from the server, and adds a failure path for every single element/property access which does not succeed? (with failure path that doesn't depend on the rest of that content) Because that's what you seem to be suggesting.
- jon-wood 11y agoHow exactly do you propose people should write JavaScript to control their UI which doesn't make at least some assumptions about that UI?