42 questions
0
votes
0
answers
15
views
JQuery trigger click does not return target id [duplicate]
I have the following jquery code to trigger a click event:
$(document).on('click','#button1, #button2',function(e){
console.log(e.target.id);
if (e.target.id == 'button1') {
$(...
0
votes
1
answer
201
views
How do I simulate jquery events to trigger Google Autocomplete?
I want to use jquery to programmatically enter a word or phrase and then trigger the Google search box autocomplete suggestions from my console.
Here is what I have tried so far:
// Inject JQuery into ...
0
votes
2
answers
289
views
Why is .trigger() not working when a selector is added to .on()?
I have an html web page that uses .load() to dynamically add a header. I am also using firebase Auth for authentication which uses .onAuthStateChanged() to identify if a user is signed in or not. ...
1
vote
2
answers
2k
views
How can I pass a parameter/argument to the onchange listener that is programmatically triggered by a call to click
In my form in one set of repeating rows (created dynamically) there is a button on each row that allows the user to upload a file which will then be linked/tied to the data in that row.
head head ...
1
vote
2
answers
161
views
Selecting all elements except for div not working with jQuery
I'm trying to select all elements in the document except for the #private_chat_menu element and attach a mouseup trigger function to them. However, it runs the function regardless of whether I click ...
0
votes
3
answers
87
views
jquery .click() does not work
on my php page I want to click a button on page load.
I have tested it with jQuery and JS.
While jQuery does not work, the JS works fine.
Any idea why this is the case?
jQuery:
<script>
$(...
0
votes
1
answer
163
views
Javascript bugs in event handling
I am trying to write a script which fill data(after i run the code in chrome console) in the registration form of a website.
I want a function in pure javascript which exactly work like a jquery ...
0
votes
0
answers
97
views
Why does triggering a 'click' result in a different Event on radioButton and Checkbox?
Triggering a click Event on a Radio Button and a Checkbox results in a slightly different result when you look at the event thta is triggered:
So triggering click on a RadioButton by doing
$('#...
0
votes
3
answers
2k
views
jquery/javascript: $(document).trigger vs normal function call?
I just saw two javascript files:
first one had called following line after some success ajax call:
$(document).trigger("locationloaded");
The second js had:
$(document).on('locationloaded', ...
3
votes
2
answers
3k
views
jQuery programatically click a tag that has javascript:void(0)
I am trying to programmatically click the "zoom in" icon three times on a page. The <a> is structured:
<a class="get-plus" title="zoom in" href="javascript:void(0)" style="display: inherit;"&...
1
vote
2
answers
5k
views
Passing parameters to $(window).on('resize') when using .trigger('resize')
I need a reliable way to detect if $(window).on('resize') has been fired by user interaction or by a jQuery .trigger call.
I've tried the following, but I don't seem to get the parameters back in the ...
20
votes
3
answers
24k
views
Triggering click event on anchor tag doesn't work
I just ran into this question
FIDDLE
Triggering click event on anchor tag is not working here.
<a class="button2" href="#popup1">hello</a>
<div id="popup1" class="overlay">
<...
0
votes
0
answers
45
views
transition of border when element size changes in jq
I want to make a smooth transition when I click the button:
<html>
<head>
<style>
span#l0 { display: inline-block;
border:20px solid red;
...
1
vote
1
answer
358
views
Passing global variable in javascript to live event on jquery does not work
I have created several elements dynamically in javascript. These are, among others, range inputs. I want on "input change" event to show the value.
Each of these inputs have id like 'probabilitate'+...
1
vote
0
answers
533
views
jQuery trigger performance
I have a performance issue with jquery trigger.
My code contains this line
$(ispan).trigger('click','itoc'); //ispan is a img element
Here the total time taken to execute this line of code is almost ...
0
votes
1
answer
81
views
Jquery on click event is not working on dynamically added Custom tags [duplicate]
Jquery on click event is not working on dynamically added Custom tags
My code is
$("[addtoShip='yes']").on('click', function() {
alert('Ship added')
});
Href for <a href="#" ...
0
votes
3
answers
57
views
Jquery executing/triggering same code on different events
I have this function onclick event of custom tag densitybtn='yes'
$("[densitybtn='yes']").on('click', function () {
var no_of_people = 0;
//calcdensity
$("[calcdensity='yes']").each(...
1
vote
0
answers
97
views
any reason why trigger function is not working? (jquery)
I have the code below.
When I trigger #tempbutton from #searchbutton (with an object as a parameter), it works fine. But when I'm doing the same thing from #myid, it won't trigger.
Any ideas what I ...
0
votes
2
answers
2k
views
Custom event not fired when called from $(document).ready();
I have the following code
$(document).ready(function () {
VerifyCustomerFilter();
$("#ToDateStor").on("DateSet", function () {
...
);
function VerifyCustomerFilter() {
...
1
vote
3
answers
1k
views
jquery trigger('click') is not working in safari with angular js
Jquery trigger('click') is not working on Safari and IE, but working on Mozilla , chrome,
I Am using AngularJS and here is my code snippet
$scope.browseFile = function () {
$('.upfile')....
1
vote
1
answer
586
views
Manually set combobox's value doesnt work before triggering change event
I'm at loss on how to manually update the combobox's selected value, before executing JQuery trigger "change" event for it to pick up the saved selected value. No matter what I do, the saved selected ...
0
votes
2
answers
3k
views
Triggering a function after an element has been fully loaded onto the page
Wondering if anyone can help because no one out there has given a solution this problem!
How do you wait for a dynamically loaded element (e.g. a specific div of another .html page) to first be fully ...
0
votes
0
answers
113
views
jQuery trigger function not working on ajax generated content
Code
How to fire click trigger on ajax generated html tag
Is Working
$(document).on("click","#Copyright #disclaimer_btn_trg",function(e){
alert($( "#DesclaimerButton span" ).html());
});
Is ...
1
vote
1
answer
7k
views
jQuery trigger reset button click
I need to reset radio buttons and checkboxes within a form via code when needed.
I am using an indirect approach, where I have placed a reset button and hidden it using CSS.
<form class="form-...
0
votes
3
answers
240
views
How can I put parametres into JQuery.Event data property and trigger it?
The goal is to pass parametres through event.data, here is complete example where I tested it : http://jsfiddle.net/
$el.trigger( $.Event('click.NGB', { example: '1' }));
$el.trigger( $.Event('click....
2
votes
1
answer
1k
views
Need to pass specific JQueryEventObject AND parameters to trigger
I am using custom events to broadcast navigation messages (between related plugins).
The simple trigger code currently looks like this:
$button.trigger('navigate', { url: link, target: target });
...
3
votes
1
answer
2k
views
jQuery trigger('click') Not Working in Chrome
I previously had the following
$('#refresh').click(function () {
$('#fileUpload').trigger('click');
});
However I've changed it so it should fire on a query parameter
function ...
0
votes
0
answers
97
views
Jquery clone with true does not clone custom events
I am cloning a select element which trigger a custom event "combobox".
when I clone the select element, custom events are not cloned.
<select id="country">
<option value="Australia">...
2
votes
2
answers
2k
views
trigger.focus replaced by $("selector").get(0).focus() in jquery1.9?
When you .trigger("focus") in IE, jQuery won't "see" the async focus event which will occur later, so it fires one of its own to ensure that a focus event always occurs as described above. This causes ...
1
vote
1
answer
164
views
Yii, jQuery: can I make jQuery code generated by ajaxLink() load before other scripts?
I'm making tabbed content in Yii manually, so the content would load data from AJAX. I'm using ajaxLink() and it works fine. The selected tab ID is stored in session so when I reload the page, the ...
0
votes
0
answers
119
views
What is the change in .trigger() in jquery1.9?
http://jquery.com/upgrade-guide/1.9/
I got this below detail from the link. But what is it that is changing in trigger(click)
event? I wasnt clear with this below explanation.
link Checkbox/radio ...
1
vote
2
answers
96
views
jquery triggering not working in firefox extension
Steps to reproduce:
i created a hai.html and using pagemod i injected scripts into that, here is the code and that hai.html https://github.com/suneeshtr/trigger-test.git
Actual results:
injection ...
2
votes
2
answers
239
views
jQuery Selector only on first level not working?
I have a simple list with a sublist
<div id="master">
<ul>
<li><div>Trigger Me!</div></li>
<li><div>Trigger Me!</div></li>
<...
0
votes
2
answers
124
views
"Out" event in a sortable is never triggered
I have a sortable (made of nested <div></div>) on my webpage. I would like that an item dragged out of the sortable be removed from the sortable.
But I can't get the "out" event to be ...
0
votes
1
answer
158
views
Fill Combo on change Trigger using JQuery
I have two DropDowns, on change event of one Drop Down, i haved filled the 2nd Drop Down.
when i trigger the change event of first drop down on Arrow Keys, its not working, while on Mouse click its ...
1
vote
3
answers
8k
views
Simulate javascript to choose from dropdown
I am trying to simulate a javascript to choose from the dropdown list below. I am trying this code here but its not working.
$('select[name="srctype"]').val(2).trigger('change');
Am i doing ...
-1
votes
1
answer
201
views
execute a change event on input that was modified by another function
I have a function that does a calculation on an input, I have a function in another script I want to run when the value of the input changes.
I try to do with the change event but does not register ...
1
vote
0
answers
174
views
jQuery Trigger Event Inline
I have created a couple of custom events, "check" and "uncheck". I can easily use jQuery to implement these like this:
$("input:checkbox,input:radio").on("click",function(){
if (j$(this).is(":...
1
vote
1
answer
41
views
jQuery stacking and unstacking triggers
The following code works. It allows you to press the enter and escape buttons. Here is a jsFiddle
$(document).on('keydown', function(e){
if (e.which == 13){
// Enter Key pressed
}
});
...
2
votes
1
answer
2k
views
Why jQuery triggerHandler() works but trigger() doesn't?
Click an element using triggerHandler() works:
$element = $('#gwt-debug-location-pill-edit-div:visible');
$element.triggerHandler('click');
But, clicking it using trigger(), doesn't:
$element....
9
votes
2
answers
5k
views
jquery triggerHandler doesn't work while trigger does
I am adding a click event to a checkbox which will show/hide additional fields depending on its checked status. I want the handler to fire on load to set up the initial page structure. For some ...
36
votes
4
answers
29k
views
triggerHandler vs. trigger in jQuery
Out of curiosity -- what is the purpose of / use cases for jQuery's triggerHandler? As far as I can tell, the only "real" differences between trigger and triggerHandler is whether or not the native ...