Trending questions in Java-Script

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,726 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,532 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
955 views
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,880 points
29,223 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
518 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,266 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,143 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,111 views
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
359 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,021 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
373 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
791 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
210 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
610 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
352 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
629 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
580 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
196 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
355 views
0 votes
0 answers

How do I format a date in JavaScript?

May 7, 2022 in Java-Script by narikkadan
• 63,420 points
242 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
209 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,667 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,880 points
23,963 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
27,362 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,880 points
28,196 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,880 points
21,955 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,880 points
27,120 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,880 points
20,350 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,880 points
23,868 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,880 points
19,878 views
0 votes
0 answers
0 votes
1 answer

How to disable all div content?

Hello @kartik, A simple way to disable any ...READ MORE

Aug 25, 2020 in Java-Script by Niroj
• 82,880 points
18,908 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,880 points
22,055 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,880 points
19,160 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,880 points
18,832 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,880 points
19,572 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,880 points
15,337 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,783 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,880 points
18,952 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,880 points
18,068 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,880 points
20,658 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,880 points
12,620 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,880 points
13,282 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,880 points
16,654 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,880 points
16,285 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,880 points
10,701 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,880 points
14,571 views
0 votes
1 answer

How to pass arguments to addEventListener listener function?

Try this: const someInput = document.querySelector('button'); someInput.addEventListener('click', myFunc, false); someInput.myParam ...READ MORE

Sep 23, 2020 in Java-Script by Niroj
• 82,880 points
10,703 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
9,973 views