jquery

Jquery fadeOut executes callback over and over again, why is this and how can I prevent this?

My method fades a div box out and has a callback that calls a method... like this: function closeWindow(windowIdPrefix, speed) { $("#" + windowIdPrefix + "_ViewPanel").fadeOut(speed, function() { resetWindow(windowIdPrefix); numWindowsOpen--; } ); } function resetWindow(windowIdPrefix) { ...

unable to access the jQuery Object within a plugin

I know this sounds pretty trivial, but the following function (return ($this).each()...`) seems to be everything but alive in my plugin, wich means that i even don't get an alert. Do you have any suggestions for a possible problem? Thx in advance. (function($){ $.fn.plugin = function() { return $(this).each(function(){ v...

jQuery Ajax fails when posting data due to keyword in post data

I know why the post fails, but I'm not sure how to resolve it and I can't find any other references to this. I'm taking our references to jEditable to make this simpler, as it happens without the jEditable plugin. So how the heck do I "escape" the keyword so that it posts correctly? Here's relevant code: Test <scri...

How do you switch off the Image Count in NyroModal (lightbox) when displaying images

When using NyroModal to display images it automatically shows the image count of how many are in the collection in the H1 tag when the popup occurs i.e. "1/3", "2/3", "3/3" Does anyone know how to siwtch this off or manipulate the h1 tag? I'm also interested in NyroModal automatically positioning the h1 tag at the bottom of the image i...

variable assignments using jQuery failing in Safari?

I'm using jQuery 1.3.2 and it's breaking under Safari 4 for mysterious reasons. All of my javascript references are made right before the tag, yet with the following code: var status = $('#status'); status.change( function(){ /* ... */ } ); The following error is displayed in the Web Inspector: TypeError: Result of expression 'sta...

ASP.NET MVC: jQuery Post and files

Hi, I have a simple form with some text inputs and a file input. I do not send it directly with a post, but I read each value of the text inputs with jQuery, compose a $.post request and send it to the server. How can I do the same with a file <input type = "file" />? I mean, sending it via ajax to a ASP.NET MVC page? Thanks in advanc...

Reading CSS height/width value are Xpx in FF while 'auto' in IE

Div box dimensions are measured using jQuery with following code: $(document).ready(function(){ var h = $("#testbox").css("height"); }); In FF it gives for me 270px, in IE auto. How can I measure actual div height/width in IE without changing it's css? ...

jqGrid Form Editing with drop downs - how to set initial value.

i have an object with 3 values ID Abbreviation Description in the jqGrid I set the grid up to display the Abbreviation. when I click to edit (using the Form Edit feature) I fill the drop down with the ID/Description combination of values via the edit options: editoptions: { value: "ID1:Description1;ID2:Description2;...;IDN:Descript...

Is there an easier way to reference the source element for an event?

I'm new to the whole JavaScript and jQuery coding but I'm currently doing this is my HTML: <a id="tog_table0" href="javascript:toggle_table('#tog_table0', '#hideable_table0');">show</a> And then I have some slightly ponderous code to tweak the element: function toggle_table(button_id, table_id) { // Find the elements we n...

jquery toggle hover items with hide delay

I put this code together from a snippet from somewhere else, so I may not be doing this very well. I have multiple div's that looks like this: <div class="services"> <p>...</p> <ol class="serviceList" style="display: none;"> <li> <p>service</p> <ul> <li>service description</li> </ul> </li> ... </ol> </div> I want...

ASP.NET, jQuery, dirty forms, and window.onbeforeunload

In my ASP.NET web app, I'm trying to create a universal way of warning users before navigating away from a form when they've made changes, using jQuery. Pretty standard stuff, but after a lot of searching I have yet to find a technique that works. Here's what I have at this point: addToPostBack = function(func) { var old__...

Jquery tab reload with a parameter

Hello: After some events in a tab, I would like to reload it. I need to send a parameter to the page that loads into the tab. The following reloads the page: $("#tabs").tabs( 'load' , 6); But, how can I send a parameter with it? ...

Calling a function in jquery click event when using classes

Hey. Let's say I have this: test = function() { this.init = function() { $("#someElement").html("Hey!").mousedown(function() { $(this).html("Clicked"); /* Now, if I wanted it to call function "dosomething" defined in the class, how would I do that? this.dosomething() obviously doesn't work. */ }); } this.dosome...

JQuery AJAX IE Inconsistencies

Hi people, Another Internet Explorer issue! The fun never ends does it... This one is related to AJAX and IE. I'm using JQuery to help build a function, that pulls in new HTML content using a PHP page, pre-loads it, and then switches the content over with the old content. Here is my code below: function showcase() { document.getElem...

asmx WebMethod caching on POST request in asp.net

I am using jQuery to get back some JSON data from the server. I am using a POST verb, but even after setting the WebMethod CacheDuration attribute, the JSON doesn't get cached. I checked the response headers with firebug and the Cache-Control is still set to no-cache. How can i cache these request on the client and avoid the server to b...

Make all text with font Helvetica have the font Arial in jQuery

I need some jQuery magic that will look for all text on a page with a given font (say Helvetica), and change the font of only that text to something else (say Arial). ...

test if event handler is bound to an element in jQuery

Is it possible to determine whether an element has a click handler, or a change handler, or any kind of event handler bound to it using jQuery? Furthermore, is it possible to determine how many click handlers (or whatever kind of event handlers) it has for a given type of event, and what functions are in the event handlers? ...

change event doesn't fire on ajax loaded forms

Hello I have an HTML document, with the jquery code $(function(){ [...] $("#newNotice").click(function(){ $("#properties").load("testDiagramm.html #NoticeForm"); return false; }); function showFormValues(){ var s = $("form").serialize(); [... Do things ...] } $("input, texta...

Storing Data in URIs After Hash

I want to store key/value pairs in URI's after the hash for use on the client side like so: http://www.foo.com/index.html#foo=bar&amp;baz=quux Is there a pre-existing solution that already does this or should I roll my own? I'm already using JQuery so a JQuery solution would be particularly welcome. My original idea was to use a reg...

jQuery: Templating data

I have a unique situation where I'm building a site that will call data via AJAX and load it into "containers" (basically just divs styled and arranged according to elements retrieved from the AJAX callback). I'm not sure how many of these unique container types will be created (styled and rendered) when all is said and done, so I'm lo...