Most voted questions in Java-Script

0 votes
0 answers

Length of a JavaScript object

I have a Javascript object and want ...READ MORE

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

How do you reverse a string in-place in JavaScript?

How do you reverse a string in ...READ MORE

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

Convert Array to Object

How can I convert this : ['a','b','c'] To this: { ...READ MORE

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

JavaScript Array splice vs slice

What is the difference between splice and ...READ MORE

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

JS file gets a net::ERR_ABORTED 404 (Not Found)

I am trying to separate my <script> inside my HTML ...READ MORE

May 16, 2022 in Java-Script by Kichu
• 19,050 points
6,194 views
0 votes
0 answers

How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

My node version is: node -v v0.6.1-pre Then I install ...READ MORE

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

How to add a class to a given element?

I am trying to create a JavaScript ...READ MORE

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

TypeError: Converting circular structure to JSON in nodejs

Code : var formData = ({first_name:firstname,last_name:lastname,user_name:username, email:email,password:password}); ...READ MORE

May 13, 2022 in Java-Script by Kichu
• 19,050 points
3,704 views
0 votes
0 answers

TypeError: Router.use() requires middleware function but got a Object

There were some changes made in the ...READ MORE

May 12, 2022 in Java-Script by Kichu
• 19,050 points
7,092 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
626 views
0 votes
0 answers

Uncaught TypeError: Cannot read property 'top' of undefined

I have two different kinds of sticky ...READ MORE

May 11, 2022 in Java-Script by Kichu
• 19,050 points
2,766 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
640 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
0 answers

Generate pdf from HTML in div using Javascript

This is my HTML code: <!DOCTYPE html> <html> ...READ MORE

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

Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)

I was trying to change a string ...READ MORE

May 9, 2022 in Java-Script by Kichu
• 19,050 points
6,478 views
0 votes
0 answers

What is the difference between React Native and React?

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
369 views
0 votes
0 answers

Why (null == false) and (null == true) both return false?

I am confused that why console.log(null == ...READ MORE

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
1,028 views
0 votes
0 answers

Response to preflight request doesn't pass access control check

I called a REST API on Amazon ...READ MORE

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
1,541 views
0 votes
0 answers

Jquery validation plugin - TypeError: $(...).validate is not a function

I am getting an error in my ...READ MORE

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
1,131 views
0 votes
0 answers

Error: Can't set headers after they are sent to the client

I am using Node.js 4.10 and Express ...READ MORE

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
1,157 views
0 votes
0 answers

How do I format a date in JavaScript?

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
251 views
0 votes
0 answers
0 votes
0 answers

How do I redirect to another webpage?

How do I redirect users to a ...READ MORE

May 6, 2022 in Java-Script by narikkadan
• 63,420 points
213 views
0 votes
1 answer

jQuery checkbox change and click event

Have shared an approach which will add ...READ MORE

Feb 23, 2022 in Java-Script by Aditya
• 7,680 points
40,589 views
0 votes
1 answer

Open a URL in a new tab (and not a new window)

Nothing an author can do can choose ...READ MORE

Feb 23, 2022 in Java-Script by Aditya
• 7,680 points
2,681 views
0 votes
1 answer

Format JavaScript date as yyyy-mm-dd

You could try using the following lines ...READ MORE

Feb 23, 2022 in Java-Script by Aditya
• 7,680 points
4,287 views
0 votes
0 answers
0 votes
1 answer

Hi, how does one kill the whatsapp message loop with a code instead of closing whatsapp-web?

Hello @Felix , Use this code: <script> function simulateMouseEvents(element, eventName) ...READ MORE

Oct 20, 2020 in Java-Script by Niroj
• 82,880 points
2,063 views
0 votes
1 answer

Which is the best Airbnb clone built with React?

Hello @rentall , For you query you can refer ...READ MORE

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

How to access a RowDataPacket object?

Hello @kartik, Turns out they are normal objects ...READ MORE

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

How do I search for a key of object in javascript?

Use hasOwnProperty(key) for (let i = 0; i ...READ MORE

Oct 14, 2020 in Java-Script by Niroj
• 82,880 points
2,097 views
0 votes
0 answers

How to generate unique ID with node.js?

This is my code: function generate(count) { ...READ MORE

Oct 9, 2020 in Java-Script by kartik
• 37,510 points
1,621 views
0 votes
1 answer

How to get browser width using JavaScript code?

Hello @kartik, Use this code: var w = window.innerWidth; var ...READ MORE

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

How to get the host url using javascript from the current page?

Hello @kartik, Use: var host = window.location.hostname; or possibly var host ...READ MORE

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

How to get the anchor from the URL using jQuery?

Hello @kartik, For current window, you can use this: var ...READ MORE

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

How to get the URL without any parameters in JavaScript?

Hello @kartik, This is possible, but you'll have ...READ MORE

Oct 9, 2020 in Java-Script by Niroj
• 82,880 points
5,556 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 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
682 views
0 votes
1 answer

How can I submit a form using JavaScript?

Hello @kartik, Set the name attribute of your form to "theForm" and ...READ MORE

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

Error:Uncaught SyntaxError: Unexpected token

Hello @kartik, Using the jQuery command getJSON and ...READ MORE

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

How to detect when a user leaves a web page using javascript?

Hello @kartik, Try the onbeforeunload event: It is fired just ...READ MORE

Oct 9, 2020 in Java-Script by Niroj
• 82,880 points
4,760 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
453 views
0 votes
1 answer

How to get the value of an input field using ReactJS?

Hello @kartik, Managed to get the input field ...READ MORE

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

How is the 'use strict' statement interpreted in Node.js?

Hello @kartik, "use strict"; Basically it enables the strict ...READ MORE

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

How can I determine the type of an HTML element in JavaScript?

Hello @kartik, nodeName is the attribute you are looking ...READ MORE

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

How can I set multiple CSS styles in JavaScript?

Hello @kartik, Using Object.assign: Object.assign(yourelement.style,{fontsize:"12px",left:"200px",top:"100px"}); This also gives you ability to ...READ MORE

Oct 8, 2020 in Java-Script by Niroj
• 82,880 points
3,196 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
499 views
0 votes
1 answer

How can I check if a checkbox is checked?

Hello @kartik, Try this: function validate() { var ...READ MORE

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

How to get the url parameters using AngularJS?

Hello @kartik, To use params simply append them ...READ MORE

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

How to test if a string is JSON or not?

Hello @kartik, Use JSON.parse function isJson(str) { ...READ MORE

Oct 8, 2020 in Java-Script by anonymous
• 82,880 points
3,683 views