jquery

Issue with selectors & .html() in jquery?

The function associated with the selector stops working when I replace it's contents using .html(). Since I cannot post my original code I've created an example to show what I mean... Jquery: $(document).ready(function(){ $("#pg_display span").click(function(){ var pageno = $(this).attr("id"); alert(pageno); var data="<span id='page...

Check for IE6 in a jQuery selector

Is there any way to do something conditionally in jquery only if IE6 is the browser? An example of the kind of thing I'm looking for is as follows: $("#someselector").IsIE6().css("position", "relative").css("left", 40); I'm plagued by a strange problem with the JQuery UI dialog and adding this code resolves the issue, but obviously m...

jQuery ID attr

$("a.close").click(function() { var id = $(this).attr("id"); alert(id); $(this).parents("div.venue:first").fadeOut("Fast"); return false; }); Any ideas why the alert isn't correctly popping up the current divs ID? Final code, thanks below for pointing my stupid error var id = $(this).parents("div.venue:first").attr("i...

jQuery selecting elements that don't yet exist

In jQuery I want to be able to select an element that does not even exist yet, how can I accomplish this? I would like to select an element by their id when they are created. Thanks. ...

Parse custom XML schema with jQuery

I am getting custom schema data back from an AJAX call and I need to parse it using jQuery. Any idea how to do this? Here's the XML: <xsd:get_customer_summary_response xmlns:xsd="http://com/acmeco/ovm/cas/xsd"&gt; <xsd:customer_details> <typ:phone_number xmlns:typ="http://com/acmeco/ovm/cas/types"&gt;1.555.5553002&lt;/typ:phone_n...

jquery Event.stopPropagation() seems not to work

Am I totally missing what this is supposed to do? I expect that if I call stopPropagation() on an event, handlers for that event won't get triggered on ancestor elements, but the example below isn't working that way (in FireFox 3 at least).. <script type="text/javascript"> $("input").live("click", function(event){ console.log("...

jQuery and $ questions

I am modifying some code that has a lot of jQuery but I am not sure what some of the jQuery statements are doing. At the top of the jQuery code there is jQuery.noConflict *1. I understand that. But then there is a some code that has: <script type="text/javascript"> (function($) { $(document).ready(function() { jQuery.fn.fixEm...

Using JQuery Tabs as Main Navigation

A JQuery UI Tab that inherits from a JQuery Theme and redirects (HTTP GET) to a new page is the goal. I'm 90% there using the following code, but the compromise has been to put the target URL in the anchor TITLE (the Tab widget expects the HREF to be a local page selector). This works, but for SEO purposes I'd like the HREFs to be actu...

hover effect jQuery

I have a bunch of li elements that I want to alternate in color using odds and evens, and then highlight based on mouse hover. In order to un-highlight I need to keep track of what the color used to be, odd or even. To do this when I apply the highlight color, I first set an arbitrary attribute to it. Are there any downsides to doing it ...

Dynamically Resizing Gridview using JQuery not working in IE6

jQuery("#divID").width(); When I resize the div using the mouse it works fine in other browsers but not IE6. For some reason the width doesn't update unless I refresh the page. Anyone experience this problem with IE6? Any solutions out there? Thanks ...

Best jQuery Date Plugin for Dates of Extreme Difference (1000+ BC - Today)

I'm working on a project right now that requires great flexibility on the date-selector. Users may insert dates several thousands of years ago, as well as dates all the way up to today. Typical date-selectors are great for selecting dates within a few years from eachother, but not too well when it comes to selecting dates of vast differe...

How to keep some input text removed by jquery when going back with browser?

Hi! I have some bug with the following page: http://jsbin.com/agedu/ Source code with some comments: http://jsbin.com/agedu/edit The problem is that when typing something and doing the query to display search results, if I go back to the search page in my browser (Firefox 3.5 but it's the same thing with IE8) there isn't my search term...

WCF, POSTing JSONized data

I have a complex type: [DataContract] public class CustomClass { [DataMember] public string Foo { get; set; } [DataMember] public int Bar { get; set; } } I then have a WCF RESTful webservice that has this in it: [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMess...

jquery toggling a div - how to do this with multiple ids?

I am new to Jquery. My setup is as follows: I have a series of divs that need to be able to be toggled (display hidden and shown). Each div has an action that can be performed so a unique ID will be necessary to know from which div the event came from. To toggle the div I have a button for each div (which is not located within the di...

Preventing iframe postback from calling jQuery 'ready' function on parent

I have an an iframe within a jQuery tab layout. I am using the iframe to upload an image, to simulate a AJAX file upload. It seems whenever my iframe postbacks, it causes the parent page's $(document).ready to execute, resetting the current tab I am positioned on. Any ideas on how to prevent this? function uploadDone() { var d...

Posting complex types using Jquery to Asp.Net MVC

I am trying to make a rest service that receives complex types from a Jquery $.ajax post but I cannot seem to convince mvc to hydrate my complex objects in the controller. The following is some of my code: Controller: [AcceptVerbs(HttpVerbs.Post)] public ActionResult ChargeUser(TransactionInfo transactionInfo, CardInfo cardInfo) { //...

javascript JQuery printing to multiple divs on page load?

I basically have several divs each with ids "id_1", "id_2" "id_3" etc. The divs are all initially empty. I want on page load to populate all the divs with certain html content. But the part that has been troubling me is that I also need to extract the unique id portion for use within the html: <div id="id_3"> <div id="inner_3></...

Can I get a jQuery object from an existing element

I have a function function toggleSelectCancels(e) { var checkBox = e.target; var cancelThis = checkBox.checked; var tableRow = checkBox.parentNode.parentNode; } how can I get a jQuery object that contains tableRow Normally I would go $("#" + tableRow.id), the problem here is the id for tableRow is something like...

Live query plugin doesn't work with the visible attribute selector

Hi, I have the following running in the jquery ready function $('[id$=txtCustomer]:visible').livequery( function() { alert('Hello') }, function() { alert('World') } ); I get an alert for the first time saying 'Hello' but the functions are not called onwards when i toggle this visibility of the textbox. Please help...

How to fetch content from a webpage?

I want to fetch div content from a webpage and to use it in my page. I have the url http://www.freebase.com/search?limit=30&amp;start=0&amp;query=cancer I want to fetch div content with id artilce-1001. How can I do that in php or jQuery? ...