JavaScript function in href vs. onclick

I want to run a simple JavaScript function on a click without any redirection. Is there any difference or benefit between putting the JavaScript call in the href attribute (like this: <a...

How can I trigger a JavaScript event click

I have a hyperlink in my page. I am trying to automate a number of clicks on the hyperlink for testing purposes. Is there any way you can simulate 50 clicks on the hyperlink using JavaScript? <a...

Is right click a Javascript event?

Is right click a Javascript event? If so, how do I use it?

Is there a way to detect, through browser Javascript, multi-touch events of a trackpad, magic mouse or magic trackpad on a Mac?

I know there are many ways to do so directly on the iPhone (jQtouch), but I'd like to detect those events in my computer's browser.

Under What Circumstances Would Javascript Performance be Worse in IE8 than IE7?

I work for a company that built interactive seating charts using Javascript. Here's an example: http://seatgeek.com/event/show/457624/miami-dolphins-at-new-york-jets-2010-12-12/. In many ways...

Bind Multiple Keys to Keypress Event

I am currently using this Javascript keypress code to fire events upon keypress: $(document).keydown(function(e) { switch(e.keyCode) { case 39: e.preventDefault(); ...

Javascript: Page reloads with eventListener click

In trying to understand javascript best practices, I'm attempting to recreate a piece of inline javascript by adding an event listener from an external javascript file. The inline code works fine...

Can we invoke click function on div class using Javascript

I have implemented colorbox functionality on a div class using <script type="text/javascript"> $(document).ready(function(){ $(".exampleclass").colorbox({iframe:true, open:true, width:"50%",...

Detect when a popup is closed

I have a popup made with: var popup = window.open(URL, ...) //content of popup is not in my control I want to know when the popup is closed, and thought the below code could help...

HTML/Javascript - Button takes two clicks to execute click event

Testing out a simple toggle display, however, it takes two clicks to toggle the display the first time. Afterwards it does it in one. <html> <head> <style> #carousel{border:2px solid...

how to detect event when user has disabled javascript in his browser?

how to detect event when user has disabled javascript in his browser, until the user reloads the page I can send a command to the server not to use javascript Thanks for the answer. Consider this...

button onclick function firing twice

I have a button that calls a javascript function using an event handler. For some reason, the event handler is being called twice. Here is my button (I am using a php object to generate the code,...

How to add a file into an already existing dataTransfer object using Javascript

Assumption: A local HTML/Javascript webpage that has access to file:// At the start of a drag on a draggable HTML element, in the event handler function dragStart(e), how do I add a File object so...

Open web in new tab Selenium + Python

So I am trying to open websites on new tabs inside my WebDriver. I want to do this, because opening a new WebDriver for each website takes about 3.5secs using PhantomJS, I want more speed... I'm...

Browser Tab Close Event for Javascript or ExtJS

How do I capture the browsers Tab Close-event in JavaScript or EXTJS. I have tried the following: <script> window.onunload = (function(){ return 'stay page ......'; ...

Docker Compose NGINX Proxy and Static Files

For some reason, my docker-compose/node/nginx stack is having trouble serving static files. The reverse proxy side works but serving my css and javascript fails. For every static file requested, I...

How to create custom event in Javascript?

I want to make my own Javascript event. Is there any possibility to create my own event just like as click, hover. I want a event that will really work. Like creating a event that will fire when...

Scrollable table with fixed columns and header, with modern CSS

How to make a table with so little JavaScript as possible using modern CSS? The features I'm trying to have is: fixed column(s) (positioning and width) scrollable in X and Y axis responsive in...

Select2 with Google Website Translator Plugin - Maximum call stack size exceeded

I have included the google website translator on my site using the following steps shown in the site below: https://translate.google.com/manager/website/ If you're not familiar with the above...

Javascript Calculator using if/else statements

I have a school project that is asking me to build a basic Javascript calculator using if/else statements. I’m very new to this language (and programming in general) and am having trouble with...

Javascript on Chrome - How to get correct heading values from the deviceorientationabsolute event?

I am trying to retrieve absolute heading values in Google Chrome on Android using javascript for a web app which uses geo location. I am listening to the new deviceorientationabsolute event: if...

how to find failed rules in json-rules-engine

I am new to the rules engine and I am trying to create a rules engine in javascript. I have the following rule and Passing one parameter as the wrong input, how to find which argument (fact) is...

Android webview not loading URL for second time

I have dynamic URL that I load into a webview. I have used a WebChromeClient to handle java script events as I need to redirect the user depending on the events from the javascript in onJsAlert()....

rawBody is missing in firebase cloud functions emulator

https://firebase.google.com/docs/functions/http-events indicates that a rawBody parameter should exist on req. However, it is undefined in my local emulator. What am I doing wrong? $ firebase...

How to create a new google meet using google calendar api

I need implement a javascript project that creates a new google meet according to the user signed in and adds the event to the calendar and gets the url of the google meet. How can i create a new...

Adding external javascript to document page in Docusaurus v2

I'm building a component library of just HTML snippet and corresponding js/css and I'm using Docusaurus to document those compoents. I have a document page for each component. On the document page...

Laravel application hang on Google Cloud Run but runs fine on home setup

I am testing out Google Cloud Run as a platform to run a new project. Project is developed using NodeJS and Laravel. Created a docker images based on php-fpm. This image runs fine on my dev...

Impossible to display list of *past* or *all* events (events manager plugin) in WP BACKEND with a particular theme

Sorry, this problem needs a longer description and I don't really have any code to post (or rather, I wouldn't know what code to post - see below)... I have two websites with two self-created...

How does Task.Yield work under the hood in Blazor WebAssembly?

How does Task.Yield work under the hood in Mono/WASM runtime (which is used by Blazor WebAssembly)? To clarify, I believe I have a good understanding of how Task.Yield works in .NET Framework and...