jquery

How to let the user chose output markup in jQuery plugin development

I develop a jQuery plugin which produces HTML output, currently something like <ul> <li><img></img></li> ... </ul> But actually, I would like to let the user of my plugin chose the HTML markup which gets generated, so for instance he passes a template string from which my plugin produces the output. But I don't know how. Are ther...

Jquery Toggle Text?

Does anybody know how to toggle text the html text of an anchor tag using Jquery. I want an anchor that when clicked the text alternates between "Show Background" & "Show Text" as well as fading in & out another div. This was my best guess: $(function() { $("#show-background").click(function () { $("#content-area").animate({opac...

JQuery Datepicker, can't trigger onSelect event manually!

I am using jquery's datepicker where a list of items is populated from an ajax call whenever a date is picked from an inline datepicker object. The script works perfect except that I can't trigger an onSelect event to populate my initial list of items. I could get around this problem by just populating the list initially using php but I...

How to get the last part in href or grandparent's id with jquery?

A list is created dynamically. Now I want to get 93 or 94 etc which will be used for php function. For example I added 93 in two ways as you can see below. In li class="93" or href="http://127.0.0.1/ci_backendpro2/index.php/messages/admin/changestatus/93" Can anyone tell me how to get this number with jquery please? Thanks in advance....

Get a list of checked checkboxes in a div using jQuery

I want to get a list of names of checkboxes that are selected in a div with certain id. How would I do that using jQuery? E.g., for this div I want to get array ["c_n_0"; "c_n_3"] or a string "c_n_0;c_n_3" <div id="checkboxes"> <input id="chkbx_0" type="checkbox" name="c_n_0" checked="checked" />Option 1 <input id="chkbx_1" typ...

keyup() bug in Firefox and Chrome ?

$('input').keyup(function(e){ var k = e.keyCode ? e.keyCode : e.which; console.log(k); }); . <input type="text" name="" autocomplete="off"/> Why keyup fires twice but only after second strike for special keys (arrows, space, backspace etc) ? - Are any solutions to fix this issue? - the autocomplete it's t...

problem with modified jquery ui photo manager

I'm using a modified version of the jquery ui photo manager example on their site. My problem i am having is i want the photo to go to an external link as well as being dragable. How do i do this? i thought it would be as simple as wrapping the image with an tag, but that doesn't work. Any ideas or thoughts? Jquery code i'm using is:...

ajax memory leak

I am experiencing a slow memory leak in both IE and Firefox using a combination of ASP.NET AJAX and jQuery. My scenario is very similar to the one described here : http://stackoverflow.com/questions/276087/preventing-ajax-memory-leaks except using jquery and asp.net AJAX, not protyotype: I have a webpage displaying data in an UpdatePane...

Is there a jQuery wrapper for .Net?

I've noticed that there are wrappers for a lot of javascript libraries and such, but I have yet to see anything significant for jQuery. Am I just not searching hard enough and there is one out there? Or is there some problem with jQuery that keeps someone from creating a wrapper? ...

position a fixed element relative to a containing element

Here is what I got so far. This effect is exactly what I want, except the position is obviously off. CSS: #rightDiv{ position: absolute; top: 200px; margin-left: 530px; } #membership{ text-align: center; height: 400px; z-index: 5; width: 329px; position: absolute; top: 190px; } #membership...

another jquery validation question

I am trying to validate a field called promoRent, if only there is a number entered. It's not a required field but if entered it has to be greater than the lotRent. I have: jQuery.validator.addMethod("PRgreaterThanLotRent", function(value, element) { return parseFloat($("#lotRent").val().replace(/[^\d\.]/g, '').replace(['.00'],'')) ...

jQuery / Javascript pass focus to next element while tabbing through page

I'm building a 'tag input' plugin with jQuery at the moment and I've hit a small stumbling block. I'm adding a button after a text input in a form, and using javascript to provide functionality for the button. When the button is clicked (or return is pressed in the input), the value of the input is added to a list of tags. The input is ...

What are the returned parameters in the jQuery ajax success option?

jQuery documentation indicates the following is returned: success(data, textStatus, XMLHttpRequest)Function A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the 'dataType' parameter; a string describing the status; and...

Jquery HTML(), clone

HI, I have a quick question should be easy, but need to make it fast I want to take with jquery one div and to put this div in another one, but the first one should be. For ex: I have HTML <div class="content">Some text</div> I want to put this content in another div <div class="test"> content div should be here </div> Jquery ...

Add and remove form fields in Cakephp

Hi Guys, Im looking for a way to have a form in cakephp that the user can add and remove form fields before submitting, After having a look around and asking on the cake IRC the answer seems to be to use Jquery but after hours of looking around i cannot work out how to do it. The one example i have of this in cake i found at - http://...

JQuery: How do I get a DID ID?

I have the following HTML: <div class="house">...</div> But in my code I dynamically insert in DIV ID's to make the code then look like this: <div class="house" id="id_1">...</div> Question: How can I get the DIV ID by only knowing the CLASS using JQuery? I've tried something like the following but it doesn't work. $('.house').ge...

Any way to compress this jquery 5 star rating function?

I'm trying to shrink this down... but can't figure out a way to do it. Basically am wondering if theres any way to compress it down to 5 lines or so?? Thanks for your help! $(function() { $('.star-one').live("click",function() { $("#rate_result").html('1'); $("#star1").html('<img src="http://larsonreviews.com/rating/star_ena.gif" borde...

Using jQuery noConflict with flowplayer tools

hi, i appear to be in the midst of troubleshooting a namespace conflict of the $() function. i'm using validate 1.4. i've attempted to use jQuery's noConflict() method, but i'm still missing something. <link href="/c/jq/ui.all.css" rel="stylesheet" type="text/css" /> <script src="http://cdn.jquerytools.org/1.1.2/full/ jquery.tools.min...

Reasons for not using JQuery to Log in user?

Im using asp.net mvc and form to log in user. I am wondering if there is any issue with using jquery to log in user instead and what I should be concerned about in terms of security as well. thanks EDIT: I ONLY MEAN PASSING THE USERNAME AND PASSWORD TO THE MVC CONTROLLER. THE SITE USES A LOT OF JAVASCRIPT. ...

jquery fill input form with url data

Hello, how i need fill out a input of my form with jquery. I have my url: http://example.com/page.html?name=YourName=Mark ...