Info
Version: | 5.0.2 |
Author(s): | [email protected] |
Last Update: | Saturday, January 23, 2021 |
.NET Fiddle: | Create the first Fiddle |
NuGet Url: | https://www.nuget.org/packages/JSconsoleExtensionsLib |
Install
Install-Package JSconsoleExtensionsLib
dotnet add package JSconsoleExtensionsLib
paket add JSconsoleExtensionsLib
JSconsoleExtensionsLib Download (Unzip the "nupkg" after downloading)
Dependencies
- Microsoft.AspNetCore.Components.Web(>= 5.0.1)
Tags
Plus, for convenience, implements 3 common window functions: alert(), confirm() and prompt() and two functions for setting web page titles and icons: title() and icon().
Examples: jsRuntime.log("Message");
jsRuntime.prompt("Please enter your age","35");
Usage:
1. Add JSconsoleExtensionsLib nuget package to your project or solution.
2.
Add "@using JSconsoleExtensionsLib" to your _Imports.razor.
3. Add "@inject IJSRuntime console" to your .razor page or component.
For repeated display, use like: console.error("Error Message");
console.log("Message");
For one-time display, use like: console.error("Error Message", true);
To turn off all console functions: JSconsoleExtensions.enabled = false;
For a complete list of JavaScript console functions see: https://developer.mozilla.org/en-US/docs/Web/API/Console.