Javascript and webdev (38)

1 Name: Anonymous Techie : 2021-11-18 16:58 ID:Heaven

I heard it's called "frontend". As opposed to "backend", everything that happens on the server side. But feel free to discuss both.

2 Name: Anonymous Techie : 2021-11-18 17:00 ID:Heaven

>null == undefined

true

>null === undefined

false

3 Name: Anonymous Techie : 2021-11-26 08:34 ID:Heaven

Apparently javascript is case sensitive. Don't go calling "Alert" when you need "alert".

4 Name: Anonymous Techie : 2021-11-30 12:45 ID:F5uejfZc

>>3
I think it would be difficult to find a language that is case insensitive for function names, SQL perhaps.

5 Name: Anonymous Techie : 2021-12-19 00:04 ID:Heaven

>>4
Common Lisp is by default. You can configure the reader to preserve the symbol case (or invert, if you don't want to SHOUT standard function names), but I don't think I've ever seem anyone use that for code. I believe at least R5RS also requires Scheme implementations to be case-insensitive.

6 Name: Anonymous Techie : 2022-03-07 10:13 ID:Heaven

Searched for "javascript performance tips"

https://www.keycdn.com/blog/javascript-performance

Interesting points are

HTTP/2 uses multiplexing, therefore allowing multiple requests and responses to be sent at the same time.

Use a compression method such as Gzip or Brotli to reduce the size of your JavaScript files.

This thing:

var Person = Object.create({
init: function(name) {
this.name = name;
},
do: function(callback) {
callback.apply(this);
}
});
var bob = new Person('bob');
bob.do(function() {
alert(this.name); // 'bob' is alerted because 'this' was rewired
});

This thing, though I prefer to keep the necessary javascript right in the html:

// load example.js without interrupting your webpage's rendering
<script src="example.js" async></script>
// load example.js after the page has finished loading
<script src="example.js" defer></script>

Animate with requestAnimationFrame

7 Name: Anonymous Techie : 2022-05-18 18:18 ID:4LpMs8SO

https://files.catbox.moe/ugk532.txt

Uploading latest version of 4-ch.net Refresher Violentmonkey script, it makes refreshing 4-ch slightly less annoying. Basically it allows you to see what boards were updated with a single click.

I posted it into https://4-ch.net/general/kareha.pl/1625420190/l50 programming and technology thread in /general/ previously, but maybe I need to actually use /tech/ somehow.

I need to add a way to make faved threads show up on top, but maybe this script is good the way it is right now. You might notice those [fav][hide] buttons, but they don't actually work yet.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: