Most viewed questions in Java-Script

0 votes
1 answer

How do I turn a string to a json in Node.js?

Hello Kartik, Use the JSON function  JSON.parse(theString) ...READ MORE

Apr 24, 2020 in Java-Script by Niroj
• 82,880 points
779 views
0 votes
1 answer

How to Scroll to the top of the page using JavaScript?

Hii @kartik, Using javascript <script> $("a[href='#top']").click(function() { ...READ MORE

Apr 2, 2020 in Java-Script by Niroj
• 82,880 points
777 views
0 votes
1 answer

Can't start Eclipse - Java was started but returned exit code=13

Your version of Eclipse is 64-bit, based ...READ MORE

Sep 20, 2022 in Java-Script by Abhinaya
• 1,160 points
766 views
0 votes
1 answer

From php returning JSON to JavaScript

Hii @kartik, You can use Simple JSON for PHP. ...READ MORE

Jun 5, 2020 in Java-Script by Niroj
• 82,880 points
763 views
0 votes
0 answers

Exception in thread "main" java.util.NoSuchElementException

Whenever I run this, the chooseCave() function works fine ...READ MORE

Sep 20, 2022 in Java-Script by Tejashwini
• 780 points
750 views
0 votes
1 answer

How to implement useEffect() so the list on the front page updates only when a name change has been detected?

Hello @kartik, Instead of passing the entire object ...READ MORE

Jun 1, 2020 in Java-Script by Niroj
• 82,880 points
742 views
0 votes
1 answer

Error:$(document).ready equivalent without jQuery

Hello @kartik, Extends DOMContentLoaded so that it can ...READ MORE

Jun 8, 2020 in Java-Script by Niroj
• 82,880 points
740 views
0 votes
1 answer

How do I return the response from an asynchronous call?

Hello @kartik, You are using Ajax incorrectly. The ...READ MORE

Jun 17, 2020 in Java-Script by Niroj
• 82,880 points
733 views
0 votes
0 answers

Basic use of JSONPath in Java

JSON and a JSONPath are both strings ...READ MORE

Sep 29, 2022 in Java-Script by Abhinaya
• 1,160 points
717 views
0 votes
1 answer

How do I remove a property from a JavaScript object?

Hello @kartik, The delete operator is used to remove properties ...READ MORE

Jul 27, 2020 in Java-Script by Niroj
• 82,880 points
710 views
0 votes
1 answer

How do I check if an element is hidden in jQuery?

Hello @kartik,  You can use CSS: class .hide { ...READ MORE

Jun 8, 2020 in Java-Script by Niroj
• 82,880 points
708 views
0 votes
1 answer

How do I copy to the clipboard in JavaScript?

Hello @kartik, To copy HTML , you can ...READ MORE

Aug 28, 2020 in Java-Script by Niroj
• 82,880 points
699 views
0 votes
0 answers

OSMdroid tiles not loading due to java.net.UnknownHostException

OpenStreetMap import and usage are required as ...READ MORE

Sep 29, 2022 in Java-Script by Abhinaya
• 1,160 points
691 views
0 votes
1 answer

What does "javascript:void(0)" mean?

After evaluating the provided expression, the void ...READ MORE

Sep 20, 2022 in Java-Script by Abhinaya
• 1,160 points
683 views
0 votes
1 answer

How to to get the key of a key/value javascript object?

Hello @kartik, You would iterate inside the object ...READ MORE

Oct 9, 2020 in Java-Script by Niroj
• 82,880 points
681 views
0 votes
1 answer

How do I get PHP errors to display?

Hello @kartik, To display all errors you need ...READ MORE

Jun 20, 2020 in Java-Script by Niroj
• 82,880 points
681 views
0 votes
1 answer

How to clone a JavaScript object?

Hello, You can clone an object and remove ...READ MORE

Apr 2, 2020 in Java-Script by Niroj
• 82,880 points
668 views
0 votes
1 answer

How do I add arbitrary html attributes to input fields on a form?

Hello @kartik, If you are using ModelForm, apart from ...READ MORE

Jul 27, 2020 in Java-Script by Niroj
• 82,880 points
657 views
0 votes
0 answers

How can I solve "java.lang.NoClassDefFoundError"?

I've tried both the examples in Oracle's Java ...READ MORE

Sep 20, 2022 in Java-Script by Tejashwini
• 780 points
648 views
0 votes
0 answers

Sort array of objects by string property value

I have this array of JavaScript objects: var objs ...READ MORE

May 10, 2022 in Java-Script by Kichu
• 19,050 points
639 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'setState' of undefined

Hello kartik, You dont have to bind anything, ...READ MORE

Apr 27, 2020 in Java-Script by Niroj
• 82,880 points
635 views
0 votes
1 answer

What is the difference between node.js and io.js?

Hello, io.js: Node-forward is basically being merged into io.js forked on ...READ MORE

Apr 24, 2020 in Java-Script by Niroj
• 82,880 points
634 views
0 votes
1 answer

How to customize the auth.User Admin page in Django CRUD?

Hello @kartik, Try this in admin.py file : from ...READ MORE

Jun 12, 2020 in Java-Script by Niroj
• 82,880 points
632 views
0 votes
1 answer

How can we parse JSON using Node.js?

Hello @kartik, You can simply use JSON.parse. The definition of ...READ MORE

Apr 24, 2020 in Java-Script by Niroj
• 82,880 points
632 views
0 votes
1 answer

How can I make a div stick to the top of the screen once it's been scrolled to?

Hello @kartik, Using javascript: var initTopPosition= $('#myElementToStick').offset().top; ...READ MORE

Sep 4, 2020 in Java-Script by Niroj
• 82,880 points
627 views
0 votes
1 answer

How do I measure the execution time of JavaScript code with callbacks?

Hello @kartik, Use the Node.js console.time() and console.timeEnd(): var i; console.time("dbsave"); for(i = 1; ...READ MORE

Sep 23, 2020 in Java-Script by Niroj
• 82,880 points
626 views
0 votes
0 answers

How does Access-Control-Allow-Origin header work?

Until now my understanding of its semantics ...READ MORE

May 11, 2022 in Java-Script by Kichu
• 19,050 points
625 views
0 votes
1 answer

Switch statement for string matching in JavaScript

Hello @kartik, Just use the location.host property switch (location.host) ...READ MORE

Jun 2, 2020 in Java-Script by Niroj
• 82,880 points
618 views
0 votes
0 answers

How to create a <style> tag with Javascript?

I'm looking for a way to insert ...READ MORE

Sep 21, 2020 in Java-Script by kartik
• 37,510 points
607 views
0 votes
0 answers

How can I create a two dimensional array in JavaScript?

Is it possible to create a two-dimensional ...READ MORE

May 9, 2022 in Java-Script by Kichu
• 19,050 points
586 views
0 votes
1 answer

How to replace all occurrences of a string?

Hello @kartik, As an alternative to regular expressions ...READ MORE

Aug 28, 2020 in Java-Script by Niroj
• 82,880 points
584 views
0 votes
1 answer

How do I include a JavaScript file in another JavaScript file?

Hello @kartik, It is possible to dynamically generate ...READ MORE

Jul 27, 2020 in Java-Script by Niroj
• 82,880 points
572 views
0 votes
0 answers
0 votes
1 answer

How can I check the existence of an element in jQuery?

Hello @ Arpit In JavaScript, everything is 'truthy' or ...READ MORE

Sep 8, 2020 in Java-Script by Niroj
• 82,880 points
544 views
0 votes
1 answer

How can we create an HTTPS server in Node.js?

Hii, The Express API doc spells this out pretty clearly. I ...READ MORE

Apr 24, 2020 in Java-Script by Niroj
• 82,880 points
544 views
+1 vote
1 answer

Error:SQL “between” not inclusive

Hello, It is inclusive. You are comparing datetimes to dates. ...READ MORE

May 28, 2020 in Java-Script by Niroj
• 82,880 points
543 views
0 votes
1 answer

How to deserializing a JSON into a JavaScript object?

Hello @kartik, To collect all item of an array ...READ MORE

Sep 3, 2020 in Java-Script by Niroj
• 82,880 points
541 views
0 votes
1 answer

How do you insert a template into another template?

Hello @kartik, You can do: <div class="basic"> {% include "main/includes/subtemplate.html" ...READ MORE

Jul 28, 2020 in Java-Script by Niroj
• 82,880 points
527 views
0 votes
0 answers

How to reset a form using jQuery with .reset() method

My code : <div id="labels"> <table class="config"> ...READ MORE

May 24, 2022 in Java-Script by Kichu
• 19,050 points
525 views
0 votes
0 answers

How to set JAVA_HOME environment variable on Mac OS X 10.9?

I just purchased a brand new MacBook ...READ MORE

Sep 22, 2022 in Java-Script by Tejashwini
• 3,820 points
522 views
0 votes
0 answers

What is the volatile keyword useful for?

Sep 29, 2022 in Java-Script by Abhinaya
• 1,160 points
513 views
0 votes
0 answers

java.net.ConnectException: Connection refused

The server side of my attempt to ...READ MORE

Sep 22, 2022 in Java-Script by Tejashwini
• 3,820 points
505 views
0 votes
1 answer

How to add an object to an array?

Hello @kartik, Put anything into an array using ...READ MORE

Sep 2, 2020 in Java-Script by Niroj
• 82,880 points
500 views
0 votes
1 answer

How do I break a string across more than one line of code in JavaScript?

Hello @kartik, In your example, you can break ...READ MORE

Oct 8, 2020 in Java-Script by Niroj
• 82,880 points
498 views
0 votes
1 answer

How do I cancel an HTTP fetch() request?

Hello @kartik, If you have an in-flight response ...READ MORE

Jun 18, 2020 in Java-Script by Niroj
• 82,880 points
498 views
0 votes
1 answer

How to disable HTML button using JavaScript?

Hello @kartik, To disable document.getElementById("btnPlaceOrder").disabled = true; To enable document.getElementById("btnPlaceOrder").disabled ...READ MORE

Oct 9, 2020 in Java-Script by Niroj
• 82,880 points
461 views
0 votes
1 answer

How can I implement my own $(document).ready functionality without using jQuery?

Hello @kartik,  Use this: var docLoaded = setInterval(function () ...READ MORE

Aug 28, 2020 in Java-Script by Niroj
• 82,880 points
461 views
0 votes
1 answer

How can I get the user's local time instead of the server's time?

Hello @kartik, For client side, you would need ...READ MORE

Jul 7, 2020 in Java-Script by Niroj
• 82,880 points
457 views
0 votes
0 answers

How do I check if an array includes a value in JavaScript?

What is the quickest and most effective method to determine whether a JavaScript array has a value? The only method I am aware of is as follows: function contains(a, obj) { ...READ MORE

Sep 23, 2022 in Java-Script by Abhinaya
• 1,160 points
451 views
0 votes
1 answer

How do I link a JavaScript file to a HTML file?

Hello @kartik, This is how you link a ...READ MORE

Oct 8, 2020 in Java-Script by Niroj
• 82,880 points
450 views