
Image from Pexels
Tagged articles - JavaScript
Found 35 articles tagged with JavaScript
28
Oct
2018
HTML5 localStorage with expiry with vanilla JavaScript
JavaScript31 titlesUsing HTML5 localStorage with expiry
0
HTML5 comes with a lot of handy features which can really improve user experience of your web application significantly if you use them wisely. Caching cold data on the client, such as lookups can significantly save the amount of traffic, page load time and even you backed services load.
One of the HTML5 features that can help you do this are sessionStorage and localStorage...read more
08
May
2018
Monitoring DOM changes with JavaScript
JavaScript31 titles Handling DOM changes with plain JavaScript
0
If you are dealing with pure JavaScript without using any library, you probably want to trigger your custom actions on some element event. This is easily done with addEventListener which is in general supported by all now days browsers. ...read more
08
Mar
2018
Handling Cross-Site Scripting (XSS) in ASP.NET MVC
.NET229 titlesHandling XSS in ASP.NET MVC with custom Razor Html helpers and HttpModule
0
Cross-site Scripting (XSS) refers to client-site code injection attack where an attacker can execute malicious scripts into a web application. Basically attacker manages to upload malicious script code to the website which will be later on served to the users and executed in their browser...read more
04
Mar
2018
Minify CSS and JavaScript files with PowerShell script
PowerShell24 titlesJavaScript and CSS file optimization with PowerShell script
0
Minification of Cascade Style Sheet (CSS) and Java Script (JS) should be on a TODO list for every web application. The minification of CSS and JS can be easily one on the runtime with ASP.NET bundling which is build in in ASP.NET framework, but in case of distributing your resource files over CDN you cannot use the runtime minification. You physical files need to be minified...read more
24
Feb
2018
Multiple file upload with ASP.NET WebApi
.NET229 titlesUpload multiple files using WebApi REST service
0
Taking out business logic from the application allows different clients running on a different platform to use same logic. REST API is a great way to decuple business logic and make it available to different clients on a different platforms. To upload files using WebApi we first need to define an action in a WebApi controller to handle files posted to the endpoint.
...read more
14
Jan
2018
JavaScript base64 image to Bitmap in C#
.NET229 titlesConverting base64 image string to Bitmap in C#
0
Base64 serialized images are useful in many cases for serving images on page. It is also a format of image that JavaScript can generate on the fly.
HTML canvas object has native support for base64 and it can be easily serialized to base64 string from JavaScript code by invoking toDataURL method of the canvas element.
...read more
09
May
2017
Non blocking CSS load on the page
JavaScript31 titlesLoad external CSS files in an async manner
0
Like JavaScript, CSS files are also loaded on the page by default in a blocking manner. Luckily for us, for JavaScript we can use either async or defer attributes on the script tag itself to change the behavior of JavaScript external file loading...read more
26
Apr
2017
Inline JavaScript and CSS tags with ASP.NET MVC
.NET229 titlesRendering inline JavaScript and CSS tags in document in MVC
0
With ASP.NET MVC Microsoft introduced bundling of JavaScript and CSS resources. These bundles work pretty well but to me it always looks not so natural to define bundles in BundleConfig.css and I had problems if I want to edit CSS or JavaScript during runtime because they are cached...read more
16
Mar
2017
Serialize html form to JSON without using JQuery
JavaScript31 titlesTransform user input from HTML form fields to JSON
0
jQuery makes things a lot easir when working with DOM. So many thing there out of the b and you do not need to worry about browsr compatibility.
Browser compatibility used to be a big deal few years back, but not it all comes to almost one engine which is WebKit.
...read more
17
Jan
2016
Copy text value to clipboard using jQuery
JavaScript31 titlesSimple sample of using jQuery to copy value to clipboard
0
I recently needed to copy some value from the web UI to clients clipboard. Since this is not something you often need to use, I googled a little bit and found that this is easy to do with document.execCommand...read more
11
Jan
2016
Resize image on the client side with JQuery
JavaScript31 titlesReducing the upload sie by resizing image on the client side
0
Image resizing is considered as a server side operation as JavaScript and HTML were not so sophisticated and HTML5 support was not widely adopted for quite some time. even now, some features are not equally supported by all major browsers.
Anyhow, HTML5 is here to stay and over time we will get more and more features supported by all browsers.
...read more
06
Sep
2015
Parse date of Facebook OpenGraph API response with JavasScript
JavaScript31 titlesConverting datetime string from Facebook API response to JavaScript Date object
0
Recently I had an issue while working on an update for my Facebook Album Browser plugin with dates returned from Facebook OpenGraph API. The dates are returned in the following form 2011-06-13T23:31:19+0000 and luckily for me, converting this string to an actual Date object in JavaScript worked pretty well for most of the browsers, but some of them like Safari on iPad did not know to convert this string to a Date object and because of that I was getting default JavaScript date 1970-01-01 00:00:00 UTC+00.
After some time spent googling and checking regular expressions, I did not find a suitable solution for this.
...read more
30
Jul
2015
Delayed execution in JavaScript
JavaScript31 titlesThread sleep equivalent in JavaScript
0
Not very often, but from time to time you need to slow down your code. Most of the time the reason for that is that you need to test some long execution, mostly external source call...read more
17
May
2015
Working with GoogleMaps in jQuery style
JavaScript31 titlesjQuery plugin for GoogleMaps
0
I've used GoogleMaps on several web projects and it seemed to me that I'm repeating a lot of code used in the previous projects which lead me to write a common Javascript library to help me easily reuse the code by only copying the JavaScript library to a project or referencing it from CDN.
I could not think of a better way to build this library than to use jQuery and build a pligin for this.
...read more
30
Mar
2015
Recognize links in text content with jQuery
JavaScript31 titlesFind and replace URLs with anchor tags inside the text
0
Very often when you are dealing with content from 3rd party like tweets from Twitter of Facebook posts and comments you might end up with some URL inside the content.
On both Twitter or Facebook or any other social network, links inside text comments are replaces with anchor tags to those URLs. In order to keep the same user experience and make it more useful o your side where you are serving the content from the other party it is recommended that you do the same.
...read more
.NET
5
Jun
2022
Using dotnet nuget package vulnerability scan in Azure DevOps build
Listing nuget vulnerabilities and controlling build in Azure DevOps
5
May
2022
Protecting static files in ASP.NET Core using custom middleware
Restricting access to specific static content with middleware in ASP.NET Core
20
Dec
2021
Supporting multiple authentication schemes in asp.net core webapi
Using more than one authentication schemes in webapi projects
12
Dec
2021
Controlling the flow of migrations in EF Core
Altering EF Core migrations execution order
28
Nov
2021
Unit of work pattern with Dapper
Implementing unit of work pattern with Dapper in .NET 5
21
Sep
2021
Adding display name to Enum values
Implementing additional values for Enum items in C#
JavaScript
28
Oct
2018
HTML5 localStorage with expiry with vanilla JavaScript
Using HTML5 localStorage with expiry
8
May
2018
Monitoring DOM changes with JavaScript
Handling DOM changes with plain JavaScript
9
May
2017
Non blocking CSS load on the page
Load external CSS files in an async manner
16
Mar
2017
Serialize html form to JSON without using JQuery
Transform user input from HTML form fields to JSON
17
Jan
2016
Copy text value to clipboard using jQuery
Simple sample of using jQuery to copy value to clipboard
11
Jan
2016
Resize image on the client side with JQuery
Reducing the upload sie by resizing image on the client side
SQL/T-SQL
22
Feb
2022
Select column names with values from SQL Server database
Fetching column names with its value in T-SQL using built in JSON methods
23
May
2020
Identifying opened connections for the specific application in SQL Server
Connection listing queries in SQL Server
3
May
2018
Reading JSON data in T-SQL on SQL Server
Extracting values from JSON string on SQL Server using T-SQL
28
Apr
2016
Create XML/HTML with T-SQL
Generating XML/HTML output in SQL Server
24
Nov
2015
IP address to octets split in TSQL
Split IP addresse into octets in SQL Server
20
Jul
2015
Getting first and last second of the current year, month and day
Using minimum and maximum date time in SQL query
Umbraco CMS
2
Mar
2018
Minify HTML output of your pages
Minification of HTML output using ASP.NET IHttpModule
18
Apr
2015
Generate sitemap.xml on the fly in Umbraco CMS
Simple sitemap.xml Umbraco handler
2
Mar
2015
Accessing UmbracoHelper in HttpHandler request
Working with UmbracoHelper and IPublishedContent in HttpHandler
14
Sep
2014
Same page language switching in Umbraco
Land on the same page in different language in Umbraco using Relations
4
Sep
2014
Getting cropped image the smart way
The way to get cropped image URL with option to load original image too
27
Aug
2014
Fastest way to return JSON result from a controller
Resturn JSON in MVC controller action