Trending questions in Java-Script

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 in Java-Script by narikkadan
• 37,660 points
696 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 in Java-Script by Kichu
• 19,040 points
517 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 in Java-Script by narikkadan
• 37,660 points
617 views
0 votes
0 answers

Convert Array to Object

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

May 19 in Java-Script by Kichu
• 19,040 points
58 views
0 votes
0 answers

JavaScript Array splice vs slice

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

May 17 in Java-Script by Kichu
• 19,040 points
65 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 in Java-Script by Kichu
• 19,040 points
44 views
0 votes
0 answers

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

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

May 11 in Java-Script by Kichu
• 19,040 points
177 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 in Java-Script by Kichu
• 19,040 points
221 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 in Java-Script by Kichu
• 19,040 points
205 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 in Java-Script by narikkadan
• 37,660 points
228 views
0 votes
0 answers
0 votes
0 answers

How do I format a date in JavaScript?

May 7 in Java-Script by narikkadan
• 37,660 points
54 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 in Java-Script by narikkadan
• 37,660 points
40 views
0 votes
1 answer

Format JavaScript date as yyyy-mm-dd

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

Feb 23 in Java-Script by Aditya
• 7,660 points
2,931 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 in Java-Script by Aditya
• 7,660 points
1,231 views
0 votes
0 answers
0 votes
1 answer

How to get the jQuery $.ajax error response text?

Hello @kartik, Try: error: function(xhr, status, error) { ...READ MORE

Jul 27, 2020 in Java-Script by Niroj
• 82,800 points
18,995 views
0 votes
2 answers

How can I set a session var using javascript and get it via php code?

Yes it is possible. You can either ...READ MORE

Aug 9, 2020 in Java-Script by Okugbe
• 280 points
19,624 views
0 votes
1 answer

How can I only detect click event on pseudo-element?

Hello @kartik, This is not possible; pseudo-elements are ...READ MORE

Oct 7, 2020 in Java-Script by anonymous
• 82,800 points
15,252 views
0 votes
1 answer

How to manage a redirect request after a jQuery Ajax call?

Hii kartik, You can resolved this issue like ...READ MORE

Apr 27, 2020 in Java-Script by Niroj
• 82,800 points
21,914 views
0 votes
1 answer

How can I send a message to a particular client with socket.io?

Hii, You can try the code below: io.to(socket.id).emit("event", data); whenever ...READ MORE

Apr 27, 2020 in Java-Script by Niroj
• 82,800 points
21,774 views
0 votes
1 answer

How to get querystring from URL using jQuery?

Hello @Kartik, The following code will return a ...READ MORE

Sep 3, 2020 in Java-Script by Niroj
• 82,800 points
14,244 views
0 votes
1 answer

How to run JavaScript code before page load?

Hello @kartik, You can use window.onpaint for such ...READ MORE

Sep 9, 2020 in Java-Script by Niroj
• 82,800 points
13,602 views
0 votes
1 answer

How can I insert a line break into a <Text> component in React Native?

Hello @kartik, This should do it: <Text> Hi~{"\n"} this is a ...READ MORE

Sep 21, 2020 in Java-Script by Niroj
• 82,800 points
12,823 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,800 points
11,758 views
0 votes
1 answer

Error:Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js

Hii @kartik,  got the same error using: <link rel="stylesheet" ...READ MORE

Jun 19, 2020 in Java-Script by Niroj
• 82,800 points
16,140 views
+1 vote
1 answer

How do I pass JavaScript variables to PHP?

Hello @kartik, You cannot pass variable values from ...READ MORE

Jul 6, 2020 in Java-Script by Niroj
• 82,800 points
15,344 views
0 votes
1 answer

How do I call a JavaScript function on page load?

Hello @kartik, If you want the onload method ...READ MORE

Sep 4, 2020 in Java-Script by Niroj
• 82,800 points
12,032 views
0 votes
1 answer

How to show progress bar while loading using ajax?

Hello @kartik, The first function calls an action ...READ MORE

Jul 6, 2020 in Java-Script by Niroj
• 82,800 points
14,170 views
0 votes
1 answer

How to send data in request body with a GET when using jQuery $.ajax()?

Hello @kartik, Sending the data in your scenario,I ...READ MORE

Jun 18, 2020 in Java-Script by Niroj
• 82,800 points
13,946 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'indexOf' of undefined

Hello @kartik, First of all, you don't need ...READ MORE

Jun 2, 2020 in Java-Script by Niroj
• 82,800 points
14,536 views
0 votes
1 answer

Error: spawn ENOENT on node.js?

Hii, Before anyone spends to much time debugging ...READ MORE

May 5, 2020 in Java-Script by Niroj
• 82,800 points
15,546 views
0 votes
1 answer

How to Store PHP variable with HTML in JavaScript in Laravel Blade Template?

Hello @kartik, The double curly brackets {{ }} will always ...READ MORE

Jun 11, 2020 in Java-Script by Niroj
• 82,800 points
13,846 views
+1 vote
1 answer

How to delete a localStorage item when the browser window/tab is closed?

Hii @kartik, You can make use of the beforeunload event ...READ MORE

Jun 11, 2020 in Java-Script by Niroj
• 82,800 points
13,664 views
0 votes
2 answers

error: Microsoft Visual C++ 14.0 is required

According to your question, it seems that ...READ MORE

Feb 8 in Java-Script by Rahul
• 9,680 points
750 views
0 votes
1 answer

How can I call PHP functions by JavaScript?

Hello @kartik, You can do Ajax request to ...READ MORE

Jul 6, 2020 in Java-Script by Niroj
• 82,800 points
12,282 views
0 votes
1 answer

How to parse Excel file in Javascript/HTML5?

Hello @kartik, Below Function converts the Excel sheet ...READ MORE

Jun 19, 2020 in Java-Script by Niroj
• 82,800 points
12,240 views
0 votes
1 answer

How to trigger jquery.ajax() error callback based on server response, not HTTP 500?

Hello @kartik, The error callback will be executed ...READ MORE

Jun 18, 2020 in Java-Script by Niroj
• 82,800 points
11,931 views
0 votes
1 answer

How to redirect parent window from an iframe action?

Hello @kartik, Use this: window.top.location.href = "http://www.example.com"; Will redirect ...READ MORE

Sep 2, 2020 in Java-Script by Niroj
• 82,800 points
8,443 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,800 points
6,522 views
0 votes
1 answer

what is the $(document).ready equivalent without jQuery?

Hello @kartik, There are three options: If script is the last ...READ MORE

Apr 2, 2020 in Java-Script by Niroj
• 82,800 points
14,523 views
0 votes
1 answer

How to call onChange event after pressing Enter key?

Hello @kartik, You can use onKeyPress directly on ...READ MORE

Oct 7, 2020 in Java-Script by anonymous
• 82,800 points
6,302 views
0 votes
1 answer

How can I read the client's machine/computer name from the browser?

Hello @kartik, You can do it with IE ...READ MORE

Sep 9, 2020 in Java-Script by Niroj
• 82,800 points
7,424 views
0 votes
1 answer

How could I call that function from the command line in nodejs?

Hello @kartik, In your db.js, export the init function. There are ...READ MORE

Oct 7, 2020 in Java-Script by Niroj
• 82,800 points
5,997 views
0 votes
1 answer

How to convert HTML string into DOM elements?

Hello @kartik, You can use a DOMParser, like so: var ...READ MORE

Oct 8, 2020 in Java-Script by Niroj
• 82,800 points
5,778 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,800 points
5,466 views
0 votes
1 answer

How to embed an External Page Without an Iframe?

Hello @kartik, You could load the external page ...READ MORE

Sep 9, 2020 in Java-Script by Niroj
• 82,800 points
6,860 views
0 votes
1 answer

How to remove all line breaks from a string?

Hello @kartik, Windows would be \r\n, but Linux just ...READ MORE

Sep 18, 2020 in Java-Script by Niroj
• 82,800 points
6,360 views
0 votes
1 answer

How to pass arguments to addEventListener listener function?

Hello @kartik, There is absolutely nothing wrong with ...READ MORE

Sep 2, 2020 in Java-Script by Niroj
• 82,800 points
6,962 views