KB Home | Advanced Search | News | Glossary | Login
Navel Knowledge Base Logo
Home » Categories » JavaScript
All Categories
Expand
Category
Apache (16)
Expand
Category
App Tools (4)
Expand
Category
CentOS (11)
Expand
Category
CMS (2)
Expand
Category
CSS Tricks (4)
Expand
Category
Electronis > (1)
Collapse
Category
JavaScript (9)
Expand
Category
iFrame (1)
article
How to change the text direction of an element?
article
Hidden image after redirect by check filename
article
XMLHttpRequest.responseURL
article
How to hide image broken Icon using only CSS/HTML?
article
Check image width and height before upload with Javascript
article
Strip HTML Tags in JavaScript
article
Regex in Javascript to remove links
article
Get The Current Domain Name With Javascript (Not the path, etc.)
Expand
Category
jQuery (5)
Expand
Category
Linux Command Line (13)
Expand
Category
MikroTik (1)
Expand
Category
MySQL (23)
Expand
Category
Network (1)
Expand
Category
Nginx (1)
Expand
Category
PHP (12)
Expand
Category
PHP Tricks (2)
Expand
Category
Smarty (1)
empty
Category
Smarty Tricks (0)
Expand
Category
SSL (1)
Expand
Category
Third-party (2)
Expand
Category
TypeScript (1)
Expand
Category
Virtualization (18)
Expand
Category
VMware (1)
Expand
Category
Webmin (10)
Expand
Category
Windows (6)
Expand
Category
WordPress (9)
JavaScript Sub-Categories
iFrame (1)
 
JavaScript Articles RSS FeedIcon Subscriber Subscribe
How to change the text direction of an element?
Viewed 697 times since Sat, Sep 26, 2020
$('input').keyup(function(){ $this = $(this); if($this.val().length == 1) { var x = new RegExp("[\x00-\x80]+"); // is ascii //alert(x.test($this.val())); var isAscii = x.test($this.val()); ... Read More
How to hide image broken Icon using only CSS/HTML?
Viewed 845 times since Wed, Sep 30, 2020
<img src="Error.src" onerror="this.style.display='none'"/>or <img src="Error.src" onerror="this.src='fallback-img.jpg'"/>   document.addEventListener("DOMContentLoaded", function(event) { document... Read More
Hidden image after redirect by check filename
Viewed 664 times since Wed, Sep 30, 2020
$("img.class").load(function() { var noImage = this.src; var xhr; var _orgAjax = jQuery.ajaxSettings.xhr; jQuery.ajaxSettings.xhr = function () { xhr = _orgAjax(); return xhr; }; $.ajax({ type: "GET", url: noImage, success: function(data) { console... Read More
Get The Current Domain Name With Javascript (Not the path, etc.)
Viewed 622 times since Fri, Oct 2, 2020
  If you wish a full domain origin, you can use this: document.location.origin And if you wish to get only the domain, use can you just this: document.location.hostname But you have other options, take a look at the properties in:... Read More
Strip HTML Tags in JavaScript
Viewed 588 times since Sat, Oct 3, 2020
const originalString = ` <div> <p>Hey that's <span>somthing</span></p> </div> `; const strippedString = originalString.replace(/(<([^>]+)>)/gi, ""); console.log(strippedString);Reference... Read More
Check image width and height before upload with Javascript
Viewed 564 times since Mon, Sep 21, 2020
var _URL = window.URL || window.webkitURL;$("#file").change(function (e) { var file, img; if ((file = this.files[0])) { img = new Image(); var objectUrl = _URL.createObjectURL(file); img.onload = function () { alert(this.width + " " + this.height);... Read More
Regex in Javascript to remove links
Viewed 564 times since Sat, Oct 3, 2020
mystr = "check this out <a href='http://www.google.com'>Click me</a>. cool, huh?"; alert(mystr.replace(/<a\b[^>]*>(.*?)<\/a>/i,""));Reference:https://stackoverflow.com/questions/960156/regex-in-javascript... Read More
XMLHttpRequest.responseURL
Viewed 545 times since Wed, Sep 30, 2020
Example var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://example.com/test', true); xhr.onload = function () { console.log(xhr.responseURL); // http://example.com/test }; xhr.send(null);Reference:https://developer.mozilla... Read More
 
Subscribe to knowledgebase
Get notified when new articles are added to the knowledgebase.