jquery

Adjusting JS modal dialog to the browser window size

I wire up Shadowbox dialog provider to my links or button like this: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, "Edit", Model.ContentType.ToString(), new {slug = Model.Slug, modal = true}, new ...

how to make complex selectors with 'this' jquery

I have an event handler that needs to do something to one of its children, based on some saved data. So what I'm currently doing is something like this: // Get the ID of 'this' item_id = $(this).attr('id'); // building a selector like $('#item1 .child_3') $('#' + item_id + ' .child_' + spVal).addClass('blah'); But this seems a little...

Why does setting document.domain require me to set it in all popups and iframes too?

I'm using a long-polling iframe solution for a chat script. Unfortunately, this requires me to set document.domain='yourdomain.com' in the iframe and main document, because the iframe is a subdomain call. The huge problem is...now all my other scripts that use popups and iframes are broken. They now require me to put document.domain i...

Disable autocomplete for all jquery datepicker inputs

I want to disable autocomplete for all inputs using jquery ui datepicker without doing this to every input manually. How could be this done? ...

how to kill an older jsonp request?

I have a cross-domain long polling request using getJSON with a callback that looks something like this: $.getJSON("http://long-polling.com/some.fcgi?jsoncallback=?" function(data){ if(data.items[0].rval == 1) { // update data in page } }); The problem is the request to the long-polling service ...

Pagination Alternatives

I am looking for ideas for pagination alternatives. I am aware of 2 pagination schemes: Click on pages pagination - my favorite example Infinite scroll pagination - one implementation here that seems to work There must be some other less known/popular ways to do it. Bonus points if you can provide a link to a demo Thanks ...

JQuery - Access children by ID from Raw HTML

I am new to JQuery, so this may be a stupid question, however I have not been able to find a solution. I have a raw HTML string stored as a JS variable, as shown below. What I would like to do is parse the HTML string as a DOM object, and be able to access and change any children within the div by their id. So, I would need to access ...

Is it possible to set async:false to $.getJSON call....

Is it possible to set async:false to $.getJSON call.... Any suggestion.... ...

Think this is a naming problem

Must be really dumb today - sorry in advance; anyhow have this unordered list <ul> <li><div class="openuserform" >Info</div> <div class="userform"></div></li> <li><div class="openuserform" >Appearence</div> <div class="userform"></div></li> <li><div class="openuserform" >Pages</div> <div class="userform"></div></li> <li><div class="open...

jQuery - fade out when clicking on parent element (and not the parents children)?

I've got the following code on my page, and what i'm trying to do is that when a user clicks outside the #loginBox, i want the entire #loginOverlay to fadeout. But i can't achieve this effect without having the fadeout triggered by clicking on #loginBox... It's placed on the bottom of the page, and i have a link on the page that trigger...

Does jQuery ajaxSetup({cache: true}) generally work?

jQuery 1.4.2 omits the timestamp GET parameter (to defeat browser cacheing) if I assert the ajax cache setting in the local context: $.ajax({ url: searcher, data: keys, cache: true, type: 'GET', dataType: 'json', success: function(data) { // something }); But it includes timestamp if I move the set...

How to call jQuery function from normal JS function?

How to call jQuery function from normal JS function? ( A + B Sample needed) So I need a jQuery function adding varA to varB. And a JS function which could call that jQuery function sending varA and varB to It and reciving result. ...

jQuery jPlayer - How to stop all players before playing a new one?

I need to stop all other instances of jPlayer before playing a new one when i click play. Thanks for you help. ...

Triggering jquery event function at page load

Here's a little jQuery function that does what I want when a checkbox is clicked, but I have a basic gap in my knowledge: How to register this so that it deals with checkboxes that are already clicked when the page loads? (Edit: Sorry, to those who already answered the question, but i've edited this to make it more clear) $(document...

Adding a loading gif to simple script

Hello everyone, Im really really new to Javascript but Ive got this script that loads the contents of a url and everything works fine. I call the plannerSpin function with an onClick method on a button but how would I go about displaying an animated gif whilst all this is going on? var xmlHttp function plannerSpin(str) { xmlHttp = G...

How does this cross-domain request work ?

$.ajax( { url : "http://search.twitter.com/search.json?q=google&amp;lang=en&amp;rpp=10&amp;since_id=&amp;callback=?", dataType : 'json', success : function(data) { alert(data.results.length); } }); How exactly is this working ? I mean the cross-domain request. ...

jQuery object IE8

So i'm trying to render a template with trimpath in IE8, but when passing the template (a jquery object) there is nothing in it. This all works in chrome,safari,firefox. So to give an example: HTML: <div id="flickr_image_gallery_preview_template"><!-- <img id="flickr_detail_button" src="/devwidgets/flickr/images/external_link.gif...

Jquery Ajax : Dynamic Function

Hi there I am trying to write a function which allows me to perform an ajax call dynamically, but am unsure how to make the key which is passed to the ajax call dynamic... At the moment, my code is like this $('#ajaxButton').click(function(){ var form = $(this).parent().find(':input'); var formVal = form.val(); var object...

JQuery jCarousel - Disabling external controls

I'm using JQuery and jcarousel, using external navigation controls: http://sorgalla.com/projects/jcarousel/examples/static_controls.html The problem here is the navigation buttons no longer disable as shown here: sorgalla.com/projects/jcarousel/examples/static_simple.html Is there a callback I can use to allow me to swap the active im...

JQuery remove .append after 5 seconds

Oh gosh here a lot today - oops Folks, best way to do this: $j('.done').append('Your services have been updated'); (that bits done) but then remove the append after say 5 seconds so that if a person resubmits a form(allowed) the append does not continue adding the text? i.e updated once "Your services have been updated", twice woul...