jquery

Having two $.ajax() calls in one script

Hi. I want to show some progress information of a server side procedure (which in fact is an ffmpeg re-encoding). The best way I though of was to use two different $.ajax() calls on myscript like this: 1) when the form is submitted (which would trigger the re-encoding) one $.ajax() would start the re-encoding like this: $.ajax({ ...

How to disable backspace if anything other than input field is focused on using jquery

How do I disable backspace keystroke if anything other than 2 specific input fields are focused on using jquery? here is my current code (NOW INCLUDING 2 TEXTBOXES): $(document).keypress(function(e){ var elid = $(document.activeElement).attr('id'); if(e.keyCode === 8 && elid != 'textbox1' || elid != 'textbox2'){ return false;...

Why doesn't the .click() not work in this instance?

Basically what this does is fadeIn pre-existing divs and then loads an image. When the image is loaded it then appends that into one of the pre-existing divs. Then it appends a new div with an id of xButton. Then later it $('#xButton').click() should hide the 3 divs. However it just doesn't work. If I change the click() to either #modalI...

How to compare if string has a enter key in the end using jquery/javascript?

I have a string value from a user input box. I have to figure out if last char is a enter key (line feed). Thats the code. Here I am checking if last char has a whitespace. Now I also have to check if last char is enter key (carriage return or line feed). How can i do this? var txt = $get("<%= txtUserText.ClientID %>"); if (txt.value.s...

Sending a JSON object to an ASP.NET web service using JQUERY ajax function

I want to create object on the client side of aspx page. And i want to add functions to these javascript classes to make easier the life. Actually i can get and use the objects (derived from the server side classes) which returns from the services. When i wanted to send objects from the client by jquery ajax methods, i couldn't do it :...

acts_as_taggable_on with finders...

I would like to use acts_as_taggable_on to do a auto suggest style tagging similar to stackoverflow below... that or facebook. But I'm unsure looking thru the rdocs what methods to use to pull all the various tags from a giving model. Article.tag_counts_on(:tags) That gives me all the tags... but i'd like to do something more advance...

Programmatically change the width/height of ColorBox onClick.

Hi, I'm using the jquery plugin ColorBox. I have a page with several item listings. Each listing has a ColorBox attached to it. $("a.modalButton").each(function(){ $(this).colorbox({ width:"933px", height:"720px", iframe:true, onComplete:function(){ //remove the text from the close ...

disallow selection inside an input element

I am looking to do the following Disallow text selection inside of an input element Do not show the cursor carrot inside of an input i cannot simply blur the input on click, focus must remain in the input. There is probably a way to do this in just IE, i would of course rather have a cross browser solution but ill settle for IE (or F...

Would this jQuery is.(":hidden") work?

Hi guys, I'm playing around with the 'is' filter in jQuery and I am currently without the opportunity to use a testing server. What I want to know is...would this work to display both hello and goodbye? $(document).ready(function(){ if ($("p").is(':visible')) { $(this).css('display','block'); } }); <p>hello</p> <p ...

Removing an item from jCarousel plug-in

Hello. I have a question regarding the jCarousel plug-in (from sorgalla). How do I remove items from it the right way? You can see how far I've gone here. Try deleting a few items and then scrolling to the right, you'll see an "emtpy scroll" eventually, and that's what I'm trying to get rid of. I've tried using the remove(); jQuery f...

Using hidden values with jQuery (and ASP.NET MVC) -- not working?

Im using a couple of JSON calls to render data, etc etc. In order to keep the proper key value, I am storing it in a tag. I have this in several places in my code, none of which cause an issue like this one is. Here is the jQuery: The call that "sets" the value: $("a[id^='planSetupAddNewPlan']").live('click', function() { ...

Code is not running on .click of hyperlink

Code is not running on .click when I have this: $(".cancel").click(function() { alert("got here"); $(this).closest(":dialog").dialog("close"); }); <a class="cancel" href=""><img src="images/cancelButton.gif" border="0" /></a> It's got to be something stupid, but I cannot see it. ...

jquery: addClass 1,2,3 etc. auto to a list

Hello, is it possible, to add auto numeric classes to a list by using jquery? html: <ul id="list"> <li>Element 1</li> <li>Element 2</li> <li>Element 3</li> <li>Element 4</li> <li>Element 5</li> </ul> i want to get something like this: <ul id="list"> <li class="1">Element 1</li> <li class="2">Element 2</li> <li class="3">Ele...

Does this incorporate JavaScript closures?

In trying to learn JavaScript closures, I've confused myself a bit. From what I've gathered over the web, a closure is... Declaring a function within another function, and that inner function has access to its parent function's variables, even after that parent function has returned. Here is a small sample of script from a recent proj...

Combine jQuery UI sortable and draggable

I want to combile jQuery sortable and draggable. Each item has three handlers Sort handler Clone handler Remove handler Sorting works fine. Cloning causes some problems, item clones itself but it makes all elements to flicker while dragging, placeholder moves from one position to other with no sense. Other question is, why sort and...

Width depends of height

Can u show me completed html code where it is some rectangle in it with "height=75% of my screen" and "widtht=4/3 of height". So, it should be 3:4 reсtangle where height depends of my screenheight, but width do not depends of my screenwidth. Only of screenheight. i thought i understood previus time, but it was not so. I have this: <s...

Add a thousands separator to a total with Javascript or jQuery?

I have a function that sums a column of data in an html table. It does so admirably only I would like to have it put the commas in there that are needed to separate the thousands. Initially, you'll note, there are commas in the numbers being added. So that the function will add them, they are removed. How do I add the commas back in ther...

FullCalendar Events: Confused how to enable resizing.

I'm using the FullCalendar plugin, and am very pleased with it, however I can't figure out how to enable resizing. I looked at the source of the calendar on the main FullCalendar page, and my code is no different save that I get my events from a source rather than explicitly define them. What am I missing? $('#schedule').fullCalendar(...

EditEase CMS help on inc files

Hi, I'm trying to build a project on EditEase. So far, I've got it up and running. But the only way i could do it was to create txt files for my content and chop up each part into txt files which will be placed on the includes folder and referenced on the actual page itself. It's taking up a lot of time doing this right now and I hope th...

Using the select on jquery tabs?

Hi I want to perform a task when I click a specific tab, let's say #tab-2. how is that done? I don't understand the documentation on the jquery site. I know how it's done on all tabs but not just one ...