jquery

Finding which element is clicked in the DOM

The question was asked to me in an interview. How to find which element is clicked by the user in the DOM using JQuery or Javascript or Both? NOTE: User can click on any element in the DOM whether it is an img, div or even span. If you can suggest some example then it will be very much helpful. Thanks in advance ...

Open a div at place clicked

Hello, I have a rather simple question but i can't seem to find an answer to it. I want when i click on any place on web page a div is opened. how can i accomplish that CSS style. My question is about the position of the div if i add this div inside a table and i want it to be opened each time i click on different rows. Thanks. ...

Checking jQuery AJAX Request Status

Hi, i do 2 different ajax request via jQuery and i have to check the other one is active or not. How can i do that ? one of example from my ajax requests: active_project_categories_ajax = $.ajax( { url: "/ajax/get_skill_list", dataType: 'json', ...... }); i need something like that: active_project_categories_ajax.status()...

Why it's giving me raw HTML?

I'm using Facebox, and when I tried to change the content of a tag, it's giving me raw HTML but the rendered form, the code snippet is: jQuery('#facebox .content').html("<%= escape_javascript(render :partial => 'form')%>"); Anybody has any idea about this? Thanks a lot. ...

Disable the first value in the select list on checkbox click

$('#bit_IsModule').click(function () { if ($('#bit_IsModule:checked').val() == "true") $("#featurename").slideUp(); else $("#featurename").slideDown(); }); I want to disable the first value in the select list on the checkbox click ? how can i do that ...

Animate absolutely positioned div, but stop if a condition is true?

Hello all, I have a div which I place at the top right-hand corner of a website, absolutely positioned at top: 0px and right : 0px. I want to use jquery's animate function to animate the div left or right a certain amount when a button is clicked, but stop the animation if at anytime, the div's offset to the left or right is less than a ...

get id parameter and increment count for each click in jquery

Hello, I want to get the id value of c_i. And each time c_i is clicked I want to increment the value at chk_count, using jquery <div id='d<? echo $i; ?>' style='margin-bottom:8px; border:#cccccc thin solid; height:25px;'> <span style='color:#cccccc; margin-right:5px;'><? echo $i; ?></span> <span><? echo $row_dw_...

Inserting a rails link into a Google Maps infowindow

Hi, I would like to insert a link into the Google Maps InfoWindow to show more information about the point the user has clicked on in my rails app. My current code: $.getJSON("/places", function(json) { if (json.length > 0) { for (i=0; i<json.length; i++) { var place = json[i]; addLocation(place); } } }); func...

What's the best way to return stuff from a PHP function, and simultaneously trigger a jQuery action?

So the title is a tad ambiguous, but I'll try and give an example. Basically, I have an 'awards' system (similar to that of StackOverflow's badges) in my PHP/CodeIgniter site, and I want, as soon as an award is earned, a notification to appear to the user. Now I'm happy to have this appear on the next page load, but, ideally I'd like it...

Display a flash message for a specific loggedin user upon receiving request.

Dears, how can i trigger a prompt (or flash message with links) display (notifying) for one of the logged in agent (specific agent screen) on my web application when receiving a request from a client. using rails and jquery. as my application is serving a call center, and the my client request ... when a call coming to the system a pro...

Radiobuttons and jQuery

Hi, I have the following radiobuttons rendered in MVC : <div class="radio" id="ModelViewAd.TypeOfAd"> <input checked="checked" id="ModelViewAd.TypeOfAd_Ad" name="ModelViewAd.TypeOfAd.SelectedValue" type="radio" value="Ad" /> <label for="ModelViewAd.TypeOfAd_Ad">Annons</label><br> <input id="ModelViewAd.TypeOfAd_Auktion" name="Model...

Ajax: Add new <div> from JSON with jQuery

Hi, In a page I have this HTML code: <div id="content"> <div class="container"> <div class="author">@Francesc</div> <div class="message">Hey World!</div> <div class="time">13/06/2010 11:53 GMT</div> </div> <div class="container"> <div class="author">@SomeOtherUser</div> <div class="...

jQuery .live() not working.

Hi there, my actual problem is that .live() jQuery method is not working. This si the code where i use it: jQuery.fn.sb_animateMenuItem = function() { var mousehoverColor = '#0089F7'; var duration = 250; return this.each(function() { var originalColor = $(this).css('background-color'); $(this)....

How to select all checkboxes with class "xxx" ?

Welcome, It it possible to select all checkboxes / uncheck all checkboxes what have class "xxx" ? I can't use "name" and "ID" because there are generated dynamical via PHP and i don't know their name. So maybye i can add class "xxx" for these what i wan't control ? Is is possible ? Or, if not possible. Maybye i can select all / uns...

Cascading dropdowns

Hi! I am working with cascading dropdowns in MVC. It appears that I will not be able to easily create dropdowns on demand, instead I will have to add the dropdowns before sending it to the client. This is how I am doing it right now: In the aspx page <%: Html.DropDownListFor(model => model.ModelViewAd.Category1, Mod...

how to get change event on created fields in jquery

I have some jquery code the creates an quantity text box. Like so <input type="text" value="1000" class="qty" name="[0].Quantity"> I wish to add some validation to this text box but can hit the method. I believe i need to utlise Live(). But can't quite figure out how this is implemented. This is where i'm at $(document).ready(fun...

jquery delay a link from being followed

I have a short css-based animation that I want to play out before a link is followed (a card that swooped in on page load swoops out after click). Currently, however, the page called loads too quickly. I want to be able to briefly delay the href from being followed. Here's what I've got: $(document).ready(function() { $("#card").c...

Any working Greasemonkey script with Jquery that works in Google Chrome?

Do you have any link\example of Greasemonkey script with Jquery that works in Google Chrome? ...

jGrowl removes my links.

If I put any links in my messages, jGrowl removes them. Can I have links in jGrowl? ...

How to show a form field ONLY if another is selected in JavaScript or jQuery?

I have a form, like so: <form action="" method="post"> <select name="pageType"> <option value="main">Main Page</option> <option value="sub">Sub Page</option> <option value="sub-sub">Sub-Sub Page</option> </select> <br /> <label>Choose Sub Sub Name:</label> <input type="text" name="sub-sub-name" /> <br /> <inp...