Most viewed questions in Java-Script

–1 vote
1 answer

How to read an external local JSON file in JavaScript?

Hello @kartik, For reading the external Local JSON ...READ MORE

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

How to find event listeners on a DOM node when debugging or from the JavaScript code?

Hii @kartik, It is possible to list all ...READ MORE

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

How to add a custom HTTP header to ajax request with javascript?

Hello @kartik, There is different way based on ...READ MORE

Aug 25, 2020 in Java-Script by Niroj
• 82,880 points
93,628 views
0 votes
3 answers

How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?

You have to download the file with ...READ MORE

Nov 29, 2022 in Java-Script by Wilson S.S
70,993 views
+1 vote
2 answers

How to convert entire div data into image and save it into directory without using canvas?

Hello @kartik, You can try the sample code ...READ MORE

Apr 29, 2020 in Java-Script by Niroj
• 82,880 points
69,955 views
0 votes
1 answer

How to set cookie value with AJAX request?

Hello @kartik, Basically, ajax request as well as ...READ MORE

Jun 18, 2020 in Java-Script by Niroj
• 82,880 points
43,263 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
39,013 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,044 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,128 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,210 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,055 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,830 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,752 views
0 votes
2 answers
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
21,955 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,813 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,594 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,126 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,788 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,515 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,066 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,916 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,775 views
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,456 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
17,973 views
0 votes
1 answer

What is callback function in JavaScript?

callback is not a keyword, its just ...READ MORE

Jan 30, 2020 in Java-Script by Niroj
• 82,880 points
17,582 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

Feb 28, 2020 in Java-Script by Niroj
• 82,880 points
17,308 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,609 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,196 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,305 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,508 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,738 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,880 points
13,705 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,232 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,543 views
0 votes
1 answer

How to access PHP session variables from jQuery function in a .js file?

Hello, You can produce the javascript file via ...READ MORE

Apr 29, 2020 in Java-Script by Niroj
• 82,880 points
12,238 views
0 votes
1 answer

How to get “value” of file upload input field in jquery?

Hello @kartik, Yes ,you can read the value ...READ MORE

Jul 8, 2020 in Java-Script by Niroj
• 82,880 points
11,966 views
0 votes
1 answer

How do I POST urlencoded form data with $http without jQuery?

Hello @kartik,  I think you need to do ...READ MORE

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

How to convert a ruby hash object to JSON?

Hello @kartik, You can also use JSON.generate: require 'json' JSON.generate({ foo: ...READ MORE

Jul 24, 2020 in Java-Script by Niroj
• 82,880 points
11,765 views
0 votes
1 answer

How to get rid of underline for Link component of React Router?

Hello, If you are using styled-components, you could do ...READ MORE

May 18, 2020 in Java-Script by Niroj
• 82,880 points
11,033 views
0 votes
1 answer

How to return AJAX response Text?

Hello @kartik, What you need to do is ...READ MORE

Jun 18, 2020 in Java-Script by Niroj
• 82,880 points
10,989 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,650 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,642 views
0 votes
1 answer

How to retrieve config and env variable in vue component?

Hello @kartik, To access your env variables in ...READ MORE

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

How to create dynamic href in react render function?

Hello @kartik, Use string concatenation: href={'/posts/' + post.id} The JSX ...READ MORE

May 18, 2020 in Java-Script by Niroj
• 82,880 points
10,541 views
0 votes
1 answer

How to “pretty” format JSON output in Ruby on Rails?

Hello @kartik, Use the pretty_generate() function, built into later versions ...READ MORE

Jul 24, 2020 in Java-Script by Niroj
• 82,880 points
10,353 views
+1 vote
1 answer

How to assign Php variable value to Javascript variable?

Hello @kartik, Try: Essentially: <?php //somewhere set a value $var = "a ...READ MORE

Jul 7, 2020 in Java-Script by Niroj
• 82,880 points
10,350 views
0 votes
1 answer

How to Get values from a specific user - queryset in Django?

Hello @kartik, You can get the list of Users ...READ MORE

May 28, 2020 in Java-Script by Niroj
• 82,880 points
10,342 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,880 points
9,905 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,892 views