jquery

Is there any unobtrusive way to hook into jQuery methods for triggers?

I was wondering if there was any unobtrusive way to hook into methods such as attr, data, css, etc and call custom triggers? Ideally, I could do something like this: $(".friend a").bind("attr.changed", changed /* data */, function(e) { alert("The " + changed.attribute + " attribute changed from " + changed.from + " to " + changed.t...

How to determine when an embedded flash object is loaded?

When embedding a flash object, is there a way to determine when it's fully loaded? That's my basic question, but for anyone interested in the details behind it: I am using the (DOMWindow) jQuery plugin. For those not familiar, it's a basic overlay the appears centered on the page, above all other content which is dimmed. Inside of the...

How do I detect if jQuery is in a document navigated to in the WinForm WebBrowser control?

I have a Windows Forms application in C#/Visual Studio 2008 with an IE WebBrowser control. In the DocumentCompleted event, I want to search the WebBrowser.Document or WebBrowser.DomDocument to see if jQuery is already present in the page. What's a good way to accomplish this? Thanks! ...

Change cloned hidden field value

I am cloning a table row using JQuery and, amongst other things, the row contains a hidden field. I want to change the value of the hidden field when I clone the row. The form field: <input type="hidden" name="items.Index" id="items.Index" value="0" /> The JQuery: var id = document.getElementById("id").value; var newId = parseInt(id...

Is there a link to the "latest" jquery library on Google APIs?

I use the following for a jquery link in my <script> tags: http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js Just wondered if anyone had discovered whether there's a link to the "latest" version: Something like the following (which doesn't work): http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js (Obviously not...

Stop the jQuery autocomplete plugin from forgetting text when the user clicks back

I'm using the jQuery autocomplete plugin to get a list of locations, which works fine. But if the user clicks the browser's back button after submitting the page with the autocomplete textbox, the textbox is empty. If I take the autocomplete off the textbox and submit & click back it remembers the text. Is there a way to stop the auto...

How to detect right mouse click + paste using JavaScript?

Is there a way to detect a right click followed by paste with JavaScript on IE and Firefox ? Update: I decided to use Jquery to do it: $('#controlId').bind('paste', null, function() { // code }); It's not exactly what I was looking (because it gets fired on 'ctrl + v' as well as in 'right click + paste' but I can work around it....

jQuery: find the next element that is not immediate?

Hello, I want to find the first span element after class counter, in code something like this: <div class="counter"></div> <p></p> <span></span> It seems like the next() function only finds the immediate next element, so something like this: $(".counter").next("span") Won't work. The way I have been using is a bit lengthy and I wa...

How can I store user feedback related to any part of a web page?

I would like users to be able to double click anywhere on the screen to display a form that allows submission of feedback about that very spot. I can think of 2 solutions: Store X,Y coordinates. Had to rule this out since X,Y coordinates aren't supported on all browsers. Use Jquery to bind an exhaustive list of html entities to a dbl...

How to duplicate one element's event handlers onto another?

How do you copy an event handler from one element to another? For example: $('#firstEl') .click(function() { alert("Handled!"); }) ; // here's where the magic happens $('#secondEl').click = $('#firstEl').click; // ???? Note that the second element is being processed at a different time to when the first element is ge...

How do you select elements based on their style?

Using jQuery, how would you find elements which have a particular style (eg: float: left), regardless of whether it's an inline style or one defined in a CSS file? ...

jQuery scripts in the response of Ajax does not work

I am using jQuery $.load() function to get content from server. the loaded content contain this: <p id="p1">123</p> <script> $(document).ready(function(){ $('#p1').html('ABC'); alert($('#p1').html()); }); </script> changing text of paragraph to 'ABC' not affected to page but alert() display 'ABC'. ...

jQuery event on responsed data from server

I have some content from server using $.ajax() function. I try to replace some element with this data and then manipulate it. Here is code: $.ajax({ type: "GET", url: "smpl.php", success: function(servmsg){ $('#panelInfo').replaceWith('<p>' + servmsg + '</p>'); } }); response from server is: <select id="years"> <option>2008...

jQuery: Why do hidden table cells get (sort of) shown again when I measure their height in FF3 and Chrome

I can successfully hide some table cells using jQuery. When I then measure the height of a hidden cell, the space that the cell would occupy if not hidden appears as blank space, pushing all the remaining cells in that row across by one column. It's as if the the cell is reinserted in the table flow, but its content is hidden. The exampl...

Find callback functions added with jQuery on DOM elements

I am currently testing this in Mozilla FireFox 3.0.5 using FireBug 1.3.0 with jQuery 1.2.6. First try document.getElementById("x").onfocus = function () { var helloWorld = "Hello World"; }; FireBug console: document.getElementById("helloworld").onfocus.toString() = function body as a string $("#helloworld").get(0).onfocus.toStr...

Any problems/disadvantages hosting jQuery at Google?

I heard that some people where having problems accessing their sites which get their jQuery from Google since their corporate firewall didn't like sites getting code from other sites, i.e. cross-site scripting? Has anyone run into problem such as this? ...

Editable Div Element

Is it possible to have an editable div element that can only contain text and images. I understand that you can use the rich controls like TinyMCE and jWYSIWYG however I do not require all this functionality and want something lightweight. Basically all I want is a plain text editable element where I can also add various images such as...

Detecting authentication timeout in handler and redirecting entire page to login page

I am writing an application where by someone can edit paragraphs on a web page. jQuery is used to send and receive the edited paragraph data to a handler, which saves it or reads it from a database. The problem is that if the forms authentication has timed out, I get the login page back from my handler. Is there any way I can detect a...

With jqGrid, can you have multiple grids on the same page with different themes?

I have a master/detail setup using jqGrid and jQuery. Is it possible to have the detail grid use a different theme/skin than the master grid? I see a setting to change the images folder, but it looks to me like grid.css would have to be the same for the entire page. Has anyone tried? Or do you have any suggestions for a workaround? ...

How do I pull the clientID of an asp:button inside an asp:listview for use with jQuery?

I'm attempting to do something which should be relatively simple. I'm using a ListView to show a number of items, using the ItemTemplate. Inside the ItemTemplate I have a div surrounding the full item, so that I can highlight on a hover event, (being handled already by jQuery). What I would like to do is have the click event on the di...