Trending questions in Java-Script

0 votes
1 answer

How to Get local IP address in node.js?

Hello @kartik, os.networkInterfaces(), — an object, that maps ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
41 views
0 votes
1 answer

How to get function parameter names/values dynamically?

Hello @kartik, The following function will return an ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
14 views
0 votes
1 answer

How to get the size of a JavaScript object?

Hello @kartik, Use this code: function roughSizeOfObject( object ) ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
11 views
0 votes
1 answer

How to stop event propagation with inline onclick attribute?

Hello @kartik, Use event.stopPropagation(). <span onclick="event.stopPropagation(); alert('you clicked inside the ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
18 views
0 votes
1 answer

How to execute a function when page has fully loaded?

Hello @kartik, That's called load. It came waaaaay before ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
16 views
0 votes
1 answer

How to reject in async/await syntax?

Hello @kartik,  throw an Error wrapping the value, which results in ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
10 views
0 votes
1 answer

How do I disable right click on my web page?

Hello @kartik, You can do that with JavaScript ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
16 views
0 votes
1 answer

How to download a file from NodeJS Server using Express?

Hello @kartik, Express has a helper for this as: app.get('/download', function(req, ...READ MORE

3 days ago in Java-Script by Niroj
• 58,500 points
14 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

3 days ago in Java-Script by Niroj
• 58,500 points
13 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

3 days ago in Java-Script by Niroj
• 58,500 points
9 views
0 votes
1 answer

How to remove all child elements of a DOM node in JavaScript?

Hello @kartik, Use modern Javascript, with remove! const parent = ...READ MORE

5 days ago in Java-Script by Niroj
• 58,500 points
33 views
0 votes
1 answer

How do I declare a namespace in JavaScript?

Hello @kartik, Try this: var yourNamespace = { ...READ MORE

5 days ago in Java-Script by Niroj
• 58,500 points
15 views
0 votes
1 answer

How do I add a delay in a JavaScript loop?

Hello @kartik, The setTimeout() function is non-blocking and will return ...READ MORE

6 days ago in Java-Script by Niroj
• 58,500 points
29 views
0 votes
1 answer

How to get the focused element with jQuery?

Hello @kartik, // Get the focused element: var $focused ...READ MORE

6 days ago in Java-Script by Niroj
• 58,500 points
21 views
0 votes
1 answer

How to copy static files to build directory with Webpack?

Hello @kartik, Requiring assets using the file-loader module ...READ MORE

6 days ago in Java-Script by Niroj
• 58,500 points
18 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

6 days ago in Java-Script by Niroj
• 58,500 points
15 views
0 votes
1 answer

How to delete a cookie using javscript?

Hello @kartik, Try this: function delete_cookie( name, path, domain ...READ MORE

6 days ago in Java-Script by Niroj
• 58,500 points
10 views
0 votes
1 answer

How to change website favicon dynamically?

Hello @kartik, Yes,you can do it by using ...READ MORE

6 days ago in Java-Script by Niroj
• 58,500 points
9 views
0 votes
1 answer

How to retrieve GET parameters from javascript?

Hello @kartik, This code gives you GET without ...READ MORE

6 days ago in Java-Script by Niroj
• 58,500 points
9 views
0 votes
0 answers

How to create a <style> tag with Javascript?

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

6 days ago in Java-Script by kartik
• 27,140 points
10 views
0 votes
1 answer

How to detect a 'touch screen' device using JavaScript?

Hello @kartik, Use this: function is_touch_device() { ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
40 views
0 votes
1 answer

How to reset <input type = “file”> using javascript?

Hello @kartik, You need to wrap <input type = ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
36 views
0 votes
1 answer

How to disable scrolling temporarily?

Hello @kartik, Do it simply by adding a ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
20 views
0 votes
1 answer

How to Obtain form input fields using jQuery?

Hello @kartik, Try this: $('#myForm').submit(function() { ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
14 views
0 votes
1 answer

How to create HTML elements using jQuery?

Hello @kartik,  if you're doing $('<div>'), jQuery will also ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
12 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 in Java-Script by Niroj
• 58,500 points
12 views
0 votes
1 answer

How to get current date and time in JavaScript?

Hello @kartik, To get time and date you ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
12 views
0 votes
1 answer

How to trigger an ajax request when the user has finished typing in a text box?

Hello @kartik, Use the code below: //setup before functions var ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
12 views
0 votes
1 answer

How to uncheck a radio button?

Hello @kartik, either (plain js) this.checked = false; or (jQuery) $(this).prop('checked', ...READ MORE

Sep 18 in Java-Script by Niroj
• 58,500 points
10 views
0 votes
2 answers

How can I set focus on an element in an HTML form using JavaScript?

Hi Kartik, try the following script <script>  (window.onload = ...READ MORE

3 days ago in Java-Script by Okugbe
• 280 points
34 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 in Java-Script by Niroj
• 58,500 points
38 views
0 votes
1 answer

How to disable asp.net button after click to prevent double clicking?

Hello @kartik, On the front end, add these ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
43 views
0 votes
1 answer

How to check Page.Validate() on client side (JavaScript) in ASP.Net?

Hello @kartik, Page_ClientValidate() will work. It returns true if ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
32 views
0 votes
1 answer

How to return JSON with ASP.NET & jQuery?

Hello @kartik, You need to do something like ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
31 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 in Java-Script by Niroj
• 58,500 points
29 views
0 votes
1 answer

Getting error while validating email address in JavaScript

Hello @Eureka , You are missing jquery library. Add ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
34 views
0 votes
1 answer

How to Determine if page is valid in JavaScript - ASP.NET?

Hello @kartik,  Make the call on an input ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
30 views
0 votes
1 answer

How do I access ViewBag from JS?

Hello @kartik, in your view write : <script> var ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
17 views
0 votes
1 answer

How to Change the selected value of a drop-down list with jQuery?

Hello @kartik, With hidden field you need to ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
23 views
0 votes
1 answer

How to disable postback on an asp Button in System.Web.UI.WebControls.Button?

Hello @kartik, Use this: <asp:button runat="server".... OnClientClick="myfunction(); return false;" ...READ MORE

Sep 9 in Java-Script by Niroj
• 58,500 points
19 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 in Java-Script by Niroj
• 58,500 points
13 views
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 in Java-Script by Niroj
• 58,500 points
20 views
0 votes
2 answers

How to animate a change in backgroundColor using jQuery on mouseover?

You don't need jquery. You can also ...READ MORE

Sep 9 in Java-Script by Eureka
• 160 points
46 views
0 votes
1 answer

verbose stack Error: missing script: start

Hello @kartik, It looks like you might not ...READ MORE

Sep 4 in Java-Script by Niroj
• 58,500 points
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 in Java-Script by Niroj
• 58,500 points
43 views
0 votes
1 answer

How to adjust width and height of iframe to fit with content in it?

Hello @kartik, <script type="application/javascript"> function resizeIFrameToFitContent( iFrame ) { ...READ MORE

Sep 4 in Java-Script by Niroj
• 58,500 points
46 views
0 votes
1 answer

How to convert an Object {} to an Array [] of key-value pairs in JavaScript?

Hello @kartik, You can use Object.keys() and map() to do this var obj ...READ MORE

Sep 4 in Java-Script by Niroj
• 58,500 points
32 views
0 votes
1 answer

How to pass an array as a function parameter in JavaScript?

Hello @kartik, Use: const args = ['p0', 'p1', 'p2']; call_me.apply(this, ...READ MORE

Sep 4 in Java-Script by Niroj
• 58,500 points
40 views
0 votes
1 answer

How to change programmatically the src of an img tag?

Hello @kartik, Give your img tag an id, ...READ MORE

Sep 4 in Java-Script by Niroj
• 58,500 points
29 views
0 votes
1 answer

How to read an external local JSON file in JavaScript?

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

Sep 3 in Java-Script by Niroj
• 58,500 points
69 views