2
votes
1answer
34 views

Using loops in javascript event delegation

I have the following piece of code: $(document).on("click", "#contentWrapper", function (e) { var page, target, clickTarget, propagationFlag; page = document.getElementById("contentWrapper"); ...
0
votes
1answer
13 views

event.target not working for nested element?

I cannot seem to get event.target to work for an element that is nested in any sort of tag in a body element. I'm capturing Javascript keystrokes and updating them into an array, like so: ...
1
vote
1answer
26 views

Firefox element.event works but element.addEventlistener does not

I am having some problems with addEventListener in Firefox. I have an iframe on my site for a WYSIWYG area I built myself. I want the iframe to look more like a normal textarea so I want a border ...
1
vote
0answers
14 views

Replace text selection event with dragstart, move, dragend OR other mouse movement events

A client of ours needs to be able to use touch-enabled Surface tablets to access our intranet application, via a browser accessed over Remote Desktop. Unfortunately, the OS they're remoting into is ...
0
votes
0answers
15 views

bootstrap and DateTimePicker events odd behavior

I have this code: $('#addOperation').on('tap', function() { $('#myModal').modal('show'); $('#myModal').on('shown.bs.modal', function() { ...
-1
votes
0answers
10 views

How to detect mouse on browser close button or active window tab close button

I want to find the mouse cursor position on a browser's close button and give an alert using javascript. I also want to detect whether the mouse cursor is on a currently active web browser tab close ...
-2
votes
1answer
73 views

How to restrict keyboard key events in web application?

I am doing the secured web application.My client requirement is to don't allow the application to refresh using the F5 . Also to restrict events of the Esc , Backspace keys. I am using the jquery ...
0
votes
0answers
34 views

Why can I find originalEvent but not event?

In my handler for events I use the following function. function handleThis(data) { console.log(data.event); console.log(data.originalEvent); } Instinctively, I'd expect both to exist. According ...
1
vote
2answers
28 views

Cant get onclick event to trigger my function in javascript

I'm working on an application that will allow me to click a button on the web page and then start my timer object. However, the timer will not start onclick. <script type="text/javascript"> ...
0
votes
1answer
22 views

blur event is not working for knockout js

Scenario is that when we enter something in a textbox and put mouse anywhere on the page there should be an alert. Tried with following fiddler code Can anybody please correct the following code ...
7
votes
6answers
89 views

Blur event not firing on <label> - can't find workaround for dealing with hide-on-blur <input> text field

TL;DR how can I get this self-explanatory JSFiddle to work? From the W3C: The blur event occurs when an element loses focus either via the pointing device or by tabbing navigation. This event is ...
-1
votes
3answers
42 views

What's the best way to event handle dynamically created HTML?

It's very easy to event-handle when dealing with items the document has from the get go: $(document).ready(function() { $('.element-in-question').on("event", function (event) { //do what ...
0
votes
0answers
21 views

Simulate right click event in UIWebView using javascript

Using Safari for OS X, I can right click in the left hand pane of this website to open a contextual menu. On iOS, I'm loading the same website in a UIWebView. I'm attempting to open the same context ...
0
votes
1answer
16 views

Unable to fetch vimeo video frame using this code

function rm(a) { var p = document.getElementById(a); imgtag = ""; ifrtag = ""; ifrsrc = ""; ifrtb = -1; img = p.getElementsByTagName("img"); ifr = p.getElementsByTagName("iframe"); for (var i = 0; i ...
0
votes
1answer
28 views

Should I stop using HTML event handler attributes [on hold]

Should I stop using HTML event handler attributes and start using addEventListener() all the time? Example: <button id="mybutton">Click me</button> <script> var b = ...
1
vote
3answers
31 views

Javascript domain protect script

I have made a .js file and I would like to protect it a little. Just from small leechers, obviously more advanced people will be able to figure it out. I'd like to add to my script, something to ...
2
votes
4answers
48 views

Continue keydown event even when an additional button is pressed

Lets say we have a ball that can be moved left and right around the screen. When you click space, the ball should jump. I got the ball to move left and right in a canvas. However, when the ball is ...
1
vote
1answer
31 views

Identify word on Javascript onhover

I was looking through stackoverflow and came across this link(how to get a word under cursor using JavaScript) They has the code: <p>Each word will be wrapped in a span.</p> <p>A ...
0
votes
1answer
30 views

detect maximize event in browser javascript

I want to close the tab when we press the maximize button in the browser. How can we detect the event of maximize button? Any help would be appreciated.
0
votes
4answers
48 views

Error : javascript Function Add to class dynamically

I am new to web development. Today I learn about classes(function) in javascript. I got an error how to call dynamically added method. My Code : <head runat="server"> ...
1
vote
2answers
24 views

How to manage html elements w.r.t their container

I have a div which represents a bread crumb. Link 1 / Link2 / Link 3 and so on. The div occupies the browser's width. Whenever I resize the browser if the available width is not enough then I want ...
0
votes
1answer
22 views

How to disable zoom Icons in Java script

I have two folders Js and zoom_assets .Inside Js i have the file custom.js and inside zoom_assets i have jquery.smoothZoom.min.js. custom.js has the functionality to open an image and ...
0
votes
0answers
29 views

How can I make Jquery AJAX wait for images with the content to complete loading before firing another event?

Ok, so I'm trying to apply the javascript masonry plugin to appended jquery content , some of which contain images that are fetched by another plugin called embedly applied to them when they're ...
0
votes
1answer
30 views

Mozilla firefox not working with window.onbeforeunload

I'm using window.onbeforeunload to display a message to the user on windows close, the function works well with chrome and IE but it doesn't work with Firefox, i'm using firefox version 26.0 i have ...
0
votes
0answers
23 views

How to handle mouse clicks on buttons of vertical scrollbar in html?

I have a div with scrollbar. I need to handle mouse clicks of the buttons of this scrollbar. How can I do this?
0
votes
1answer
30 views

onchange event for html canvas in javascript

Is there something like onchange for canvas? I would like to have an event that fires up every time when something changed in canvas. <html> <body> <canvas id="canvas" ...
-3
votes
1answer
45 views

What will be the easiest java code form of the following code [closed]

I am using following php code to upload file from client side to server with some conditions. 1- One file at a time and file size less than 35mb. 2- File only support "jpeg", "jpg", "png", "wav", ...
2
votes
2answers
48 views

Why does the onclick fire next function not assigned to it?

Why clicking the button fires the alert? It is assigned to the paragraph, not button. HTML: <button onclick="foo()">Click me</button> <p id="hidden" style="display:none"> I was ...
0
votes
3answers
54 views

click event is called more than once in jquery

I have following code. In this code first I am adding input field and button to #container. Then I attach click event to the button.confirm. When it is clicked on the first time, it invokes ...
0
votes
2answers
21 views

Prototype: how to get new input value after some key pressed?

I would like to check an email after customer pressed any key. This is my code: document.observe("dom:loaded", function() { $('billing:email').observe('keypress', function(event){ ...
0
votes
1answer
25 views

Using “ImagesLoaded”-Plugin on event in AngularJS

If a part of my page is re-rendered I'd like to display a loading indicator. It is noticed by an event emitted from the re-rendered part. I use http://desandro.github.io/imagesloaded/ Inside my ...
0
votes
1answer
34 views

How do I make my second event work?

<script type='text/javascript'> var farhen; var celesius; var kelvin; function FtoC() { farhen = document.getElementById("F").value var para = ...
1
vote
3answers
42 views

Access all event listeners in javascript

I want to do something like this: function('string', function2(){}) where I leave the to user to write what he wants in the string parameter and than execute function2. The catch is here: string is ...
0
votes
1answer
35 views

HTML 5 input check: the validation message appears only by repeated calling

I have a form including two password fields (password, password confirmation). I need their issues about different values to look like a standard HTML-5 pop-up message (see the illustration pls). For ...
0
votes
0answers
39 views

How to do stuff when pushing and releasing a image in javascript

I'm trying to figure out how the touchstart and touchend in javascript (jquery mobile) works. I have tried a lot of different things, and it usually works when I test it in my browser. However, when ...
1
vote
2answers
55 views

How to create a single event handler for a variety of events in JavaScript

I want to do the following with JavaScript/jQuery: JavaScript Pseudo code! $.bindalleventhandler('[action]', eventHandler); eventHandler = function(trigger, element){ if(trigger == 2 ...
0
votes
1answer
20 views

Can I get the element that addEventListener() was registered to from the callback?

When using EventTarget.addEventListener(), is it possible to get the element that the listener was registered to when the callback is called? I'm aware of the event.target property, but that is the ...
2
votes
1answer
35 views

Javascript flow in creating DOM nodes

If i insert some element into DOM tree document.getElementById("settings-details-form").innerHTML = "<h2 id=\"ddd\">hello</h2>"; does the next line of JS code will be executed before ...
0
votes
0answers
29 views

How to pass event data from jQuery .on() to a seperate JavaScript function?

I've got a jQuery event handler like this: $(document).on("input propertychange", ".qty-target", checkQtyTarget); And a JavaScript function like this: function checkQtyTarget(event) { if ...
2
votes
0answers
24 views

Detect multi-touch finger positions in IE10/IE11

I'm developing in JavaScript for IE10/IE11, and am trying to get custom multi-touch events to work. I'm using the MSGesture API, and it provides a nice abstraction layer, but I would like access to ...
-1
votes
1answer
34 views

Resetting all fields in a form when it is opened

I have two forms that lies under two tabs in a portlet. When I click on tab 2 i want all fields in that form to be empty. I don't want a button. I tried with function resetForm($form) { ...
0
votes
2answers
52 views

JavaScript onclick event fired without any click

I'm trying to clean the urls of elements and every thing is working, but the onclick event fired directly on the page load but not when I click. How can I fix this. HTML: Today call list ...
1
vote
3answers
39 views

Delegate clicks through canvas to image map

JSFiddle: http://jsfiddle.net/6WMXh/170/ I have a canvas with a snowy effect overlaying the web page, and I want to delegate clicks through the canvas to the element beneath which was meant to be ...
0
votes
1answer
30 views

Two set Intervals makes infinite loop

I'm making a simple game, and I want to move 2 objects(two images of a cup) with setInterval. After all of the function calls it will draw the picture into another place, makes it look like it's ...
0
votes
0answers
21 views

locating specific scripts functions that are applied on any given DOM element in the browser using chrome developer tools?

I am looking for the specific scripts functions that are applied on any given DOM element in the browser. I am using the chrome developer tools for this. I am able to locate the style rules in a very ...
2
votes
2answers
33 views

Backbone event does not trigger with submit

I have the following Backbone view: var EditBook = Backbone.View.extend({ el: '.page', render: function (id) { var that = this, book = new Book({ id: ...
0
votes
2answers
39 views

Running order change in Javascript

I'm trying this code, but when i test in my browser (New Chrome) the move_1_3 function happens first, and then the move_1_2, could you please help how to correct it? (in the code i want to change the ...
1
vote
4answers
37 views

How to stop page from auto refreshing if the visitor is adding a reply / keystroke with my current code?

I am using the following code to auto refresh my website page after a specific time interval. However, users sometimes are in the process of answering a forum discussion or have already entered some ...
0
votes
2answers
28 views

jQuery.load(); not always firing with images

I have a script which fades in an image when it is loaded to prevent ugly loading animations, which uses the $(elem).load(); function. My problem is that sometimes there will be a couple of images on ...
0
votes
0answers
44 views

How to get jsf datatable row index on mouse click without using checkbox or radio button

I have used JSF hx:datatableEx datatable component to display document list. Values for the table fetched from the database. Now I want to add an event such that when user does "right click with ...

15 30 50 per page