jquery

JQuery finding an element within Iframe (by its text) and adding .click function to it

Hello, I have a webpage (A) and I am embedding (A) to my mainpage (B) using iframe. This (A) contains a link which closes the browser window: <a href="" onclick="window.opener = window; window.close(); return false;">Close The Page</a> Since I embedd (A), the close ability in (A) is no more functional. What I need to do is, w...

how to auto refresh MVC PartialView every second

Hi , i need to auto refresh a partialView in the page every second (or a set interval of time) i thought of the following method is this rite loop { setInterval(function() { <%Html.RenderPartial("partialview", Model);%> } ,1000 ); } or is there a better way using ajax stuff ? ...

how to unbind the event

i'm bind a dropdown ("#dropdownlist").change(function(){}); i'm calling the above code so many time. how can i unbind this event before binding it each time....? ...

Jquery - Adding a function to element within Iframe?

I tried a lot of ways but non of them worked. For example that one works: $('#iframeid').ready( function() { alert('Hello'); } ); but following doesn't (alerts hello but do not focus.) $('a:link').click( function() { alert('Hello'); var iframeRef = document.getElementById("if...

Strange looping problem with jQuery when I try to delete an entry...

I have tried to document this as well as I can in the code. Getting a weird looping thing when I try to delete an item that I've added. Example: I have 3 items that I've added: When I try to delete the very first item in the list...I get the confirm Delete dialog 3 times Deleting the second item in the list...I get the confirm 2 tim...

Why is the dom out of sync after jquery ajax call and refresh?

I have table that uses inline editing with ajax to modify the fields. The table is sorted by last name. If I change a last name so the row order is changed and then do a page refresh, the table is reordered but the field I changed still has the previous value in the dom. The input field does have the correct value in the html but the ...

Change border-bottom color using jquery?

I want to change the color of the bottom border using jquery..Thanks ...

Jquery event bind/unbind and lib hooks

Greetings, I am using facebox popup jquery plugin. In their JS they have the following event /* * Bindings */ $(document).bind('close.facebox', function() { $(document).unbind('keydown.facebox') $('#facebox').fadeOut(function() { $('#facebox .content').removeClass().addClass('content') hideOverlay() $(...

Jquery Pagination

I am trying my hardest to learn jQuery with the "Learning Jquery 1.3 Book from Packt". I am following the code to the letter but I am finding it hard to get the code working. I am trying a simple Page Pagination with the following code but I am having no luck can any one tell me why and offer some advice. Thanks. $(document) .ready...

I've learned jQuery, should I go back and learn "proper javascript"?

I'm primarily a server side developer, working professionally with PHP. For javascript I always use a framework (jQuery/mootools), will this be a professional disadvantage for me down the line? Should I put the time in to learning straight javascript, or are most developers moving over to frameworks anyway? Thanks. ...

I lose focus from the main page

I am opening a window that is not in my domain and I can not do to maintain the focus on my window. This is the code. The work is only for IE. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv...

MooTools vs JQuery

I just inherited some web pages which uses MooTools. I never used MooTools. Now I need to add some functions on the page, I wonder if it's a good idea to use jquery and mooTools on the same page? Basically, I have 3 options, Convert the pages to JQuery, which I have to learn MooTools to do that. Write new functions in MooTools. I have...

How can I add, remove, or swap jQuery validation rules from a page?

UPDATE: I've come up with a solution to this which I've written as the accepted answer below. Another option is to apply validation rules to all elements initially, add an ".invalid" class to elements you don't want to validate. Swap this class in & out of elements you want to validate as needed. I have a form that toggles what input ...

JQuery - slowly bg-image changing

Hello, I'm trying to make my hover-action with slowly bg-image changing. .menu_part { border-left: 1px solid black; background-image: url(../images/bg_menu.png); float:left; padding: 2px 10px; } .menu_part:hover { background-image: url(../images/bg_menu_hove.png); color: #FFF; } Men...

jquery in enterprise : Things to consider

We all know Jquery has tons of benefits it has to offer. If you have used Jquery in enterprise, what was your "learning" experience?; what needs to be taken into consideration from backward compatibility, conflict with existing javascript, CSS class structures, performance, jquery size / Caching, additional plugins etc to improve and le...

Tricky delay on mouseover

This is what I have currently: $("#cart-summary").mouseenter(function () { $('.flycart').delay(500).slideDown('fast'); }); $(".flycart").mouseleave(function () { $('.flycart').delay(500).slideUp('fast'); }).find('a.close').click(function(){ $(this).parents('.flycart').hide(); }); What it does is: If mouseover #cart-summary -> op...

Autocomplete "setup", jquery

I'm trying to get auto-complete working with a simple application that I'm building. Here is my code so far: gMeds = new Array(); $(document).ready(function(){ var autoComp = setUpAutoComplete(); if(autoComp) { $("#med").autocomplete(gMeds); } else { alert('Autocomplete unavailable'); } }); function ...

Delay with hoverintent

var config = { sensitivity: 3, interval: 5000, timeout: 5000, }; $("#cart-summary").hoverIntent(function () { $('.flycart').slideDown('fast'); }, function() { $('.flycart').slideUp('fast'); }).find('a.close').click(function(){ $(this).parents('.flycart').hide(); }); ...this works, but...

registering event to newly added selector

I am adding and removing items from a ul. However, I cannot remove items that were just added. I am assuming I need to register the event when the item is added. How to do this please? ...

Is jQuery('.foo').find('.bar') equivalent to jQuery('.bar', jQuery('.foo'))?

Using: var $a = $('.foo').find('.bar'); var $b = $('.bar', $('.foo')); I know $b will have its context set to $('.foo'), while $a. Aside from that, I believe the two objects are the same, correct? Follow up Qs: Will the perf be the same as well since the search is rooted off of the same object effectively? Does a more strict cont...