Tagged Questions
0
votes
1answer
24 views
Is using javascript setters and getter properties to watch for changes a bad idea?
Using Object.create one can define setter and getter methods in javascript.
o = Object.create(Object.prototype, {
fooBar: {
get: function() { return "Meh" },
set: function(value) { ...
0
votes
0answers
10 views
Revealing module pattern client side memory optimisation and suggestions
I have separated out the different parts of my javascript/JQuery clientside code used on a webpage.
The code makes some ajax calls to get Json to load a grid. The standard document onload event does ...
0
votes
2answers
23 views
Backbone event firing on click OR press enter
I am new to backbone and I am looking for a way for my button to be triggered when I press enter as well as clicking. Currently showPrompt only executes on a click. What is the cleanest DRYest way to ...
2
votes
0answers
25 views
Can not register function for option in pjax
Pjax will not allow me to specify functions as an option when calling it directly.
$(document).on('click', 'a.inferno-preview', function(event) {
return $.pjax.click(event, {
container: ...
-2
votes
0answers
23 views
Event Handler & anonymous function, variable reference issue [duplicate]
Try the following simple script:
<button>button</button></br >
<button>button</button></br >
<button>button</button></br >
...
0
votes
0answers
30 views
Backspace not working for textbox in Firefox but works in IE
I have a situation where in for a text box control the backspace is working fine in IE and Chrome but not in Firefox.
control code
<td nowrap="nowrap" class="PageNumber">Page# <input ...
0
votes
3answers
39 views
Passing argument to function I don't want to execute immediately
Sorry if my question seems naive (a bit of a newbie here), but I seem not to be able to get a simple answer to my question.
In JavaScript I try something like this
window.onload = init; *// ok, ...
0
votes
0answers
27 views
Javascript event for input selection range changed
Consider the following scenario:
I have 2 inputs side by side.
Both have a focus event handler that selects all the text inside.
Both have a change event handler that invokes a third party ...
0
votes
3answers
33 views
addEventListener on all elements
Hi I want add event listener to any element of the page. For example I want alert any message when I click anything.
document.addEventListener('click', function(){alert('asd');}, true)
And it ...
-2
votes
0answers
32 views
Bootstrap Submenu Close on Click [on hold]
I am a complete noob when it comes to Javascript, and I seriously need your help. What I want to do is pretty simple. I am working with Bootstrap 3.0.2 on a menu with submenus as seen exactly in:
...
2
votes
1answer
41 views
Google Apps Script validation issue in Google UiApp
This is my first post on here and I hope that one of one you will be able to show me what I am doing wrong. I have been trying for 2 days straight to figure out Google Apps Script validation in Google ...
0
votes
1answer
13 views
Sending events to an iFrame on a different domain?
So I've run into the problem where the contentDocument on an iFrame is not accessible to me because it's on a different domain, but I need to find some way to send touch events to elements within this ...
0
votes
5answers
38 views
Javascript for Prompt input and output sort to alphabetical order
I am trying to create a prompt box for the user to enter data, but the output should display the words in alphabetical order.
Input: A line of text, using prompt. Output: The words of the
input ...
-1
votes
1answer
48 views
Java Script Counter Function with Array Parameter [on hold]
I would like to create the following JavaScript to be used on a webpage.
Function: counter
Parameter: An array of numbers.
Returns: The numbers of negative elements, zeros, and values greater than ...
0
votes
1answer
15 views
How did I just enabled my dropdown menu for tactile devices?
I have a dropdown menu for desktop visitors with a HTML looking like the follwing:
<ul id="nav">
<li class="nav_header "><span class="main_menu_title">SERVICES</span>
...
0
votes
1answer
31 views
sending an event object
whenever an event causes javaScript code to run an event object named event is created.
Does the keyword "event" represent all types of events (for example mouse events, keyboard events etc..) ?
...
0
votes
2answers
44 views
jQuery .on event binding
I have a jQuery Javascript working with blocks (2, .delegate) and (3, .ready+.click) below for detecting whenever the user clicks a given checkbox. However, if I use the block (1, .on, as recommended ...
0
votes
0answers
42 views
Identify user-highlighted images on a page
If I have an html page with a number of images displayed, and a user drag-selects several images (i.e. highlights them as selected) with a mouse, can I identify those images via Javascript or ...
0
votes
1answer
27 views
How to handle event fired before listener is attached
Code fires event on success ajax response. Event listener is attached in function after this code for some reasons. Is it possible to catch already fired event and handle it on adding listener or I ...
-3
votes
1answer
39 views
Image carousel in 10 lines of code or so [closed]
I'm a PHP/MySQL guy with a front end problem. I've set up a loop that returns 20 list items which are images that are stacked horizontally. Now, I'd appreciate help with some jQuery code that does two ...
0
votes
1answer
22 views
Permission denied to access property 'filepicker_comm_iframe'
Currently facing an issue with Filepicker's iframe in my application... my tools:
Framework: Rails 4 (including turbolinks)
API: Filepicker.io (JS)
File type: Coffeescript
My sample code:
ready ...
0
votes
4answers
52 views
Avoiding multiple click events on a button
I have next and previous button on my web page. They get next and previous page on the available middle portion. The response of the new page comes from the server.
If user clicks on the button ...
0
votes
1answer
30 views
How to prevent page scrolling when page is updated with AJAX? [closed]
I have an element at the top of my page that update using a jQuery timer. The issue I am experiencing is that everytime the content of that element is updated, the browser will pop back up to the top ...
0
votes
0answers
19 views
Android click location in WebView
Trying to capture a long click on my WebView and then fire a single click in the JavaScript in response but I think something's going wrong with the coordinates.
Here's what I have at the moment. It ...
0
votes
0answers
54 views
Why the button click doesn't work from the GUI, but does work from the console?
Why could a button, which has a click() event do not work in browser, but work from the js console:
<div class="text-center" id="my_button_div">
<button class="btn my_button btn-danger" ...
-1
votes
1answer
47 views
Checkbox states retrieval issue using javascript
I have check boxes against folders in the tree structure.Can someone suggest me for one issue which I am facing in the check-box states. I need to retrieve the checked states for the check-boxes from ...
0
votes
0answers
21 views
jquery.trigger context on custom events
I'm having an issue with maintaining proper context when triggering an event from within the handler of another event. Essentially, I am reading the attribute of an element to determine whether or not ...
1
vote
2answers
34 views
Why does not bind() or apply() work here, but call() does?
Take this very simple framework I am experimenting with (so that I can learn JavaScript's function prototype more in depth.)
(function(){
var app = {
ui: {
app: ...
0
votes
0answers
85 views
Are angular $broadcast and $on expensive?
I've been told that using angular events can be expensive (I've been unable to verify this)
Any calls to $broadcast and $on should be 'wrapped' with a factory or service to inject into their ...
-1
votes
2answers
41 views
Need Guidance in learning advanced Javascript concepts
I am having experience of more than 3+ yrs in ASP.net (Web Forms & MVC) development , I have used javascript mainly for validations or modifying HTML structure (most of basic stuff) .
I am ...
0
votes
1answer
51 views
What event is triggered when the value of an input field is changed?
I'm using a JavaScript library that occasionally changes the value of an input field. I want to detect when that happens.
Apparently, the 'change' and 'input' events are not triggered when the value ...
1
vote
1answer
39 views
Is there a way to get IE 10+ to fire an event when the overflow of an element changes?
I want to test if a div is overflowing. The following code works for webkit and FF.
var div = $("#myDivWithOverflow")[0];
var OnOverflowChanged = function(){
...
0
votes
1answer
36 views
onbeforeunload event with apache wicket
I've a problem with the JavaScript event "onbeforeunload" in Apache Wicket.
What I want to do: I've a variable which tells me if data has changed. Now I want to open the JavaScript confirm dialog ...
0
votes
1answer
24 views
javascript: visual issue when dragging image by eventListener
I'm making a script to drag an image in a frame using eventListener instead of .onSomeEvent:
var destForm, destFoto, destX, destY;
function destaqueIni(){
destForm = ...
3
votes
1answer
111 views
Change image based on Radio Button Selection in HTML/JavaScript
I have a project where I am to have an image displayed for three different radio button groups. If a radio button is selected, the image needs to change to a different pic. I have the rest of the ...
0
votes
0answers
45 views
Checkbox persistence issue on page load in Javascript
I want to save the check-boxes state in the checked state on page-load or refresh using the local storage session of the Firefox or IE browser. I am using the local storage concept in java-script in ...
1
vote
1answer
26 views
javascript onpopstate alternative with same functional like onhashchange
I've search on google and some other questions in this forum, but it seems not answered my question.
Based on MDN https://developer.mozilla.org/en-US/docs/Web/API/window.onpopstate :
Note that ...
0
votes
3answers
42 views
How to tell what Javascript event just fired
Is there any way in Javascript to tell what the most recently-fired event was? Reason I'm asking is I'm working on a site that isn't behaving properly on one of those new Ultrabooks that's running ...
0
votes
1answer
34 views
double click prevented but prevent default does not work
I am using code from this post and the double click prevention works, however the button still does not respond to preventDefault
Can anyone lend a hand please.
js:
var myBtn = $('.myLink');
var ...
2
votes
2answers
34 views
Chrome Update broke my 'devicemotion' event handler
On my website, I've had some Javascript that's been running perfectly fine for over a year now (and I pride myself on it working in every browser, as far as I can tell). But recently it suddenly ...
1
vote
2answers
78 views
javascript or ajax function when someone clicks on browser close button [duplicate]
I want to call a function when someone click on close button of browser. I gone through many posts and questions on stackoverlow and google groups. But couldn't find a way to accomplish this task. I ...
1
vote
0answers
44 views
Prevent typeahead.js dropdown from closing on select
How can I prevent a typeahead dropdown from closing when an item is selected? I've tried using preventDefault like this:
$('#q').bind('typeahead:selected',function(obj, datum, name) {
...
0
votes
1answer
16 views
how to prevent inner html elements from capturing javascript events?
On my computer, the described issue only happens in Chrome and Opera (and not in IE or Firefox). But I think it is related rather to javascript than to any specific browser.
Here is the fiddle: ...
1
vote
1answer
35 views
setTimeout doesn't start instantly
When I put the following function in the head of my document :
(function(){
var d = new Date().getTime();
console.log(new Date().getTime() - d);
window.setTimeout(function(){
...
0
votes
1answer
37 views
Access to a class property in a callback
I started recently to learn patterns in Javascript and trying to understand how it is working by simulating "classes". So most probably this error is coming because of a bad understanding of how it is ...
1
vote
1answer
47 views
Adding events to detect when all dynamically added scripts are loaded
There are no errors thrown in the code, so I can only assume either the events aren't getting triggered or they aren't getting added properly. Can anyone determine what the issue is here?Code below. ...
3
votes
4answers
40 views
Check a radio button by clicking the <a> associated with it
I have a set of elements like this:
<div class="input-group">
<span class="input-group-addon">
<input type="radio" name="location-radio" />
</span>
...
0
votes
1answer
234 views
ajax InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
Very strange issue...I am trying to pass multiple values to a method in post. It works fine as long as I dont post as an object. But when I try to post as an object I get the error
Uncaught ...
1
vote
1answer
32 views
Javascript drop down menus for year intervals
I have two drop down menus that are used to set up year intervals for an sql query. These drop down menus are populated using an sql query as well. I have them both working, but I would like to ...
0
votes
3answers
36 views
Is it possible to detect an onclick event immediately following an onchange event?
<!DOCTYPE html> <!-- HTML5 -->
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p><button type="button" onclick="show()">Show new ...