256 Kilobytes

Web Development Answers > JavaScript

Type AnswersAsk and answer questions, if that is something that you want to do. Category Web DevelopmentContent about developing websites, web applications, and other similar projects. Tag JavaScript

Profile Photo - Some Guy

What is the difference between Java and Javascript?

Answers in Client-Side | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplySee also: https://www.256kilobytes.com/content/show/1916/javascript-vs-ecmascript-vs-typescript-vs-coffeescript-differences-what-to-use-and-when... August R. Garcia,

See also:

Tue, 31 Dec 2019 22:42:18 -08001 year ago1
🗨 4
🐏 0
👁 923
Profile Photo - August R. Garcia

[Solved] Implementing an "Estimated Time to Crack" Notification for Registration Forms

Answers in Client-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

Probably edit slightly for a cleaner UI<...

MoreProbably edit slightly for a cleaner UI Code and demo: Message Here  <form> <input id="test" type="text" /> <span i...
🗨 0
🐏 0
👁 331
Profile Photo - August R. Garcia

[Solved] Enabling Shades/Tints of All Colors in CKEditor

Answers in Client-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

There is a CKEditor plugin called Color...

MoreThere is a CKEditor plugin called Color Button that can be used to add buttons to CKEditor instances to change font colors and background colors....
🗨 0
🐏 0
👁 449
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Code:

MoreCode: <form> <button class="btn" onclick="doubleclick_confirm_submit(event, this);" type="button">Ban/Unban</button> <...
🗨 0
🐏 1
👁 331
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Easiest solution I found was to add a cu...

MoreEasiest solution I found was to add a custom attribute based on ondrag[something] events and to then use a CSS attribute selector: <script>...
🗨 0
🐏 1
👁 357
Profile Photo - August R. Garcia

[Solved] Automatically apply color scale to HTML table with JavaScript

Answers in Client-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

*Basically solved

MoreHere's some code. However, this code is fairly slow on large tables (adds roughly 50-150 milliseconds for 190 rows of four columns). Probably usu...
🗨 0
🐏 0
👁 461
Profile Photo - August R. Garcia

[Solved] How to automatically replace newlines with commas when data is pasted into an HTML

Answers in Client-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyCan add a few more regex lines to trim empty commas: el.value = el.value.replace(/\n/g, ', '); el.value = el.value.replace(/\t/g, '... August R. Garcia,

Can add a few more regex...

Fri, 09 Aug 2019 19:44:27 -07002 years ago1
🗨 1
🐏 0
👁 507
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Title.

MoreTitle. <!DOCTYPE html> <html> <head> <title>Test Table Download</title> </head> <body> <h1&g...
🗨 0
🐏 0
👁 425
Profile Photo - Some Guy

[JavaScript] QuerySelector not working for multiple attributes?

Answers in Client-Side | By Some Guy

Published

Profile Photo - Default

Last ReplyYou should show some code. But this error generally is thrown when you use space between attributes. document.querySelector("[data-id='1'] [data-... Ali,

You should show some code...

Wed, 29 May 2019 05:23:00 -07002 years ago1
🗨 1
🐏 0
👁 643
Profile Photo - Some Guy

JavaScript - How to hide a dialogue on click?

Answers in Client-Side | By Some Guy

Published | Last Update

Profile Photo - Default

Last ReplyDid you mean "<dialog>" tag? If so, you can use JS API like that; HTML5 Content <dialog open> <p>Greetings, one and al... Ali,

Did you mean "<dialog&...

Tue, 28 May 2019 23:24:45 -07002 years ago1
🗨 2
🐏 0
👁 581
Profile Photo - Some Guy

[JavaScript] Can JS check if keydown/keyup is a comma, but not the less than symbol ( < )?

Answers in Client-Side | By Some Guy

Published | Last Update

Profile Photo - Univa

Last ReplyHere's a simple solution that will catch all characters, backspace, and delete.  $("input").keydown(function(event) {     var isW... Univa,

Here's a simple solution...

Sun, 05 May 2019 03:01:05 -07002 years ago1
🗨 1
🐏 0
👁 582
Profile Photo - Some Guy

Finding the last updated date of a page with JS?

Answers in Client-Side | By Some Guy

Published

Profile Photo - WTCMolybdenam4753

Last ReplyThere is a simple solution to finding the last update of a page in JS! Simply enter "javascript:alert(document.lastModified)" -without the quotes, int... WTCMolybdenam4753,

There is a simple solutio...

Sat, 30 Mar 2019 14:45:42 -07002 years ago1
🗨 1
🐏 0
👁 534
Profile Photo - Some Guy

Re-enabling right click on sites that have it disabled?

Answers in Client-Side | By Some Guy

Published

Profile Photo - Graln_of_Truth

Last ReplyYou can try disabling Javacript and then reloading the page; this seems to be the most common issue however there are several other things you can try... Graln_of_Truth,

You can try disabling Jav...

Sat, 30 Mar 2019 13:56:19 -07002 years ago1
🗨 1
🐏 0
👁 492
Profile Photo - Some Guy

[JavaScript] Decode all HTML entities?

Answers in Style and Layout | By Some Guy

Published

Profile Photo - roxblade

Last ReplyThere are many ways of doing it, through jQuery as well as JavaScript. One way that I'm fond of that preserves the tags while doesn't have the jQuery... roxblade,

There are many ways of do...

Fri, 01 Feb 2019 03:05:55 -08002 years ago1
🗨 1
🐏 0
👁 508
Profile Photo - Some Guy

How to make an SVG graph (HTML)?

Answers in Web Development | By Some Guy

Published

Profile Photo - roxblade

Last ReplyThere are many amazing tutorials for SVG graph generation. I like to believe that the CSS-Tricks page is one of the most helpful resources. Daniel Pat... roxblade,

There are many amazing tu...

Wed, 23 Jan 2019 08:23:35 -08002 years ago1
🗨 1
🐏 0
👁 494
Profile Photo - Some Guy

How to graph a parabola using JavaScript and/or PHP?

Answers in Server-Side | By Some Guy

Published

Profile Photo - Some Guy

MoreI am working on a project and I am unsure of the software I will be using. I need to graph a parabola using JavaScript and/or PHP. Could anyone show m...
🗨 0
🐏 0
👁 296
Profile Photo - Some Guy
Profile Photo - Some Guy

MoreI'm trying to make it so that when an image is clicked a cookie will be set, how do I do this in an HTML document?
🗨 0
🐏 0
👁 316
Profile Photo - Some Guy

[JavaScript] Why does this code not work correctly? Code: function multiply(a, b){ a * b }

Answers in Client-Side | By Some Guy

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyThe function should state "return a * b;" instead of "a * b;" // Define the function function multiply(a, b){ return a * b;... August R. Garcia,

The function should state...

Fri, 11 Jan 2019 23:47:22 -08002 years ago1
🗨 1
🐏 0
👁 7,001
Profile Photo - Some Guy

Fix "Cannot set property 'innerhtml' of null"?

Answers in Style and Layout | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyYou probably have a line of code that looks something like this: document.getElementById('whatever').innerHTML = "New inner HTML"; The error... August R. Garcia,

You probably have a line...

Mon, 17 Dec 2018 15:45:01 -08002 years ago1
🗨 1
🐏 0
👁 340
Profile Photo - Some Guy

How do you convert a string to a CharArray in Java?

Answers in Client-Side | By Some Guy

Published

Profile Photo - Some Guy

I am currently learning JavaScript and h...

MoreI am currently learning JavaScript and had a question about strings and charArray. Is there a way to convert a string inti a charArray?
🗨 0
🐏 0
👁 486
Profile Photo - Some Guy
Profile Photo - Hash Brown

Last ReplyThere are a number of javascript libraries that do this, take a look at this one: https://github.com/canvg/canvg Hash Brown,

There are a number of jav...

Tue, 04 Dec 2018 22:43:32 -08002 years ago1
🗨 1
🐏 0
👁 403
Profile Photo - Some Guy
Profile Photo - Hash Brown

Last ReplySuper simple! In pure Javascript: <script type="text/javascript"> function theKeyPress(e){ var keynum; if(window.event) {... Hash Brown,

Super simple!

Tue, 04 Dec 2018 22:24:29 -08002 years ago1
🗨 1
🐏 0
👁 492
Profile Photo - Some Guy

Is there a way to create a CSS color scale based on a div's value/innerHTML content (or vanilla JS)?

Answers in Client-Side | By Some Guy

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyAm fairly sure there is no built-in way to do this with pure CSS, but definitely doable with JS/jQuery. August R. Garcia,

Am fairly sure there is n...

Mon, 03 Dec 2018 06:15:47 -08003 years ago1
🗨 1
🐏 0
👁 501
Profile Photo - Some Guy

[PHP]/JS] Pass a PHP array to a JavaScript function?

Answers in Server-Side | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyThe json_encode() function can do this. Ex:<script> insert_chart( 'pie_users_by_account_type' , <?= json_encode($arr); ?>, &#03... August R. Garcia,

The json_encode() functio...

Sun, 02 Dec 2018 03:48:41 -08003 years ago1
🗨 1
🐏 0
👁 377
Profile Photo - Some Guy

How to check "if classlist contains" using JavaScript

Answers in Client-Side | By Some Guy

Published

Profile Photo - August R. Garcia

Last Replyvar c_menus = document.getElementsByClassName("c_menu");for (var iii = 0; iii < c_menu.length; ++iii) { c_menu[iii].addEventListe... August R. Garcia,

var c_menus = document.ge...

Sun, 02 Dec 2018 03:48:26 -08003 years ago1
🗨 1
🐏 0
👁 553
Profile Photo - Some Guy

[JavaScript] addEventListener to all in array?

Answers in Client-Side | By Some Guy

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyUse this instead of a static variable. for (iii = 0; iii < arr.length; ++iii) arr[iii].addEventListener("click", function(e) { this.... August R. Garcia,

Use this instead of...

Sun, 02 Dec 2018 03:47:55 -08003 years ago1
🗨 1
🐏 0
👁 415
Profile Photo - Some Guy

How to round to two decimal places in Javascript?

Answers in Client-Side | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyThe function that you're looking for is .toFixed(2):https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFix... August R. Garcia,

The function that you&#03...

Sun, 02 Dec 2018 03:47:05 -08003 years ago1
🗨 1
🐏 0
👁 454
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplySomething like this should work:// Add a hidden input to store the IDsvar hidden_input = document.createElement("INPUT");hidden_input.setAtt... August R. Garcia,

Something like this shoul...

Sun, 02 Dec 2018 03:47:00 -08003 years ago1
🗨 1
🐏 0
👁 460
Profile Photo - Some Guy

Tic Tac Toe using HTML, CSS, and JavaScript.

Answers in Web Development | By Some Guy

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyPartial solution. IIRC, I didn't finish writing this before posting (?)  <!DOCTYPE HTML> <html> <head><title>P... August R. Garcia,

Partial solution. IIRC, I...

Sun, 02 Dec 2018 03:46:16 -08003 years ago1
🗨 1
🐏 0
👁 309
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplySomething like this should work: <script> function create_thing(element) { // do something with an element passed to the function... August R. Garcia,

Something like this shoul...

Sun, 02 Dec 2018 03:46:03 -08003 years ago1
🗨 1
🐏 0
👁 495