How can one generate and save a file client side using Blazor?

Creator of Blazor Steve Sanderson used JavaScript interop for similar task during one of his last presentations. You can find example on BlazorExcelSpreadsheet Solution includes three parts: 1) JavaScript function saveAsFile(filename, bytesBase64) { var link = document.createElement(‘a’); link.download = filename; link.href = “https://stackoverflow.com/questions/52683706/data:application/octet-stream;base64,” + bytesBase64; document.body.appendChild(link); // Needed for Firefox link.click(); document.body.removeChild(link); } 2) C# … Read more

What is NPM and why do I need it? [closed]

npm is a package manager for Node.js with hundreds of thousands of packages. Although it does create some of your directory structure/organization, this is not the main purpose. The main goal, as you touched upon, is automated dependency and package management. This means that you can specify all of your project’s dependencies inside your package.json … Read more

How can a web server handle multiple user’s incoming requests at a time on a single port (80)?

A port is just a magic number. It doesn’t correspond to a piece of hardware. The server opens a socket that ‘listens’ at port 80 and ‘accepts’ new connections from that socket. Each new connection is represented by a new socket whose local port is also port 80, but whose remote IP:port is as per … Read more

Chrome – Disable cache for localhost only?

You can certainly prevent all your file from hitting the cache, but this is an all-or-nothing setting. You can’t decide which files get cleared from the cache and which files stay in the cache. During development, since you are using Chrome, I’d recommend to enable the setting for “Disable cache (while DevTools is open)”: If … Read more

Why is javascript the only client side scripting language implemented in browsers? [closed]

Well, Google is trying to buck that trend with Dart. The community hasn’t been entirely receptive to the idea; either. Google proposed adding multiple VM support for Webkit which didn’t go down very well. One particular comment summed it up nicely as to why there has been some resistance to that: In this case the … Read more

Inline SVG vs SVG File Performance

Pros for inline: Fewer http requests; You can use css fill property and change the color; Svg is part of the content, so it is clickable and you can insert text; Pros for separate file: Svg files can be cached; You don’t see multiple lines of irelevant code in your files; If you need to … Read more

Jquery ui – sortable: drag by icon ‘handle’ within sortable element

The option handle of the plugin allows you to define that is the element that can initiate the sort. You can provide a selector or an element. If you have this html, with the .handler to be the handle to start the sort: <ul class=”sortable”> <li> <span class=”handle”></span> My element </li> </ul> Apply the option … Read more