jquery

Use markitup or masked input plugin (for example) on several elements, created after page loading?

hi, here is a small example with the masked input plugin : //apply the mask to an input $('.st').live('click', function() { $(this).mask("99:99"); }); .st is a text input with a td, the use can clone the td. However, when you clone this td, and try to click in the .st of the new element, your gain the focus of the first .st and it'...

jQuery AJAX request gets called twice when using Jquery, Django and Google App Engine

I'm using Google App Engine, Jquery and Django. I want POST data to be sent to the server side when a form is submitted, and I do this in JQuery with the following code: $("#listform").submit(function() { $.ajax({ type: "POST", url: "/xhrtest", data: {'name': 'h...

Validate form client-side, server-side or both in Ajax form?

I'm developing this app which as a very basic Ajax form and I'm currently validating the form input through jQuery with it's default validation plugin. I'm wondering if I should also do server-side validation after submitting the form or just ignore and assume everything is right since the client-side validation was successful? There's...

is it possible to get the current location (url) of an external page loaded in a jqModal window?

Dear all, As the title, is it possible to get the current location (url) of an external page loaded in a jqModal window? And further, in the implementation of the jqModal, in where the external page is located? iFrame or div? Thanks for your kindly advise. BRs, William Choi ...

jQuery remove similar classes

Is there any better way to rewrite this ? $('element').removeClass('class-1').removeClass('class-2').removeClass('class-3').removeClass('class-5') ... to .removeClass('class-105') :) i want to remove all class-(n) classes Thanks ...

Is there a better way to do this ajax call

$('#request_song').autocomplete({ serviceUrl: '<%= ajax_path("trackName") %>', minChars:1, width: 300, delimiter: /(,|;)\s*/, deferRequestBy: 0, //miliseconds params: { artists: 'Yes' }, onSelect: function(value, data){ artist = $('#request_artist').val(); //this will return "The Killers" //make an ajax request to "...

Using Jquery.Corner to achieve bordered bevels?

Using this: http://malsup.com/jquery/corner/ I set up my nested divs so the container acts as a border like so: $('#top').corner("bevel 68px").parent().css('padding', '1px').corner('bevel 70px'); <div id="ctop"> <div id="top"> //stuff </div> </div> Now this works with rounded corners, the borders run along the edge. However,...

Getting mouse co-ordinates using jQuery

I am building a breakout game using jQuery and the <canvas> element. To control the paddle, it will follow the mouse. So I need to get the mouse co-ordinates in my drawPaddle() method. Looking on the jQuery site it has examples like this: $(document).mousemove(function(e){ $('#status').html(e.pageX +', '+ e.pageY); }); Which does...

jquery validate: how can I make a field validate on change?

On jquery's validate plugin, an error message only disappears after the user has made focus on another element. I want to make it disappear as soon as the right info is written. How can validation be triggered 'onchange'? ...

disable paste (control V) in IE for an input text box

Is there a way to disable the paste (control V) into a text box using javascript/jquery for IE? I do not have access to the markup unfortunately or I would use onPaste="return false". Can it be attached with Jquery? If it cannot be disabled at least is there a way to detect it so that when the paste event occurs just remove the text ...

I have a json object now how do I make a div with the elements

I am using getJson to pull in some info onto the page $('#request_song').autocomplete({ serviceUrl: '<%= ajax_path("trackName") %>', minChars:1, width: 300, delimiter: /(,|;)\s*/, deferRequestBy: 0, //miliseconds params: { artists: 'Yes' }, onSelect: function(value, data){ // alert('You selected: ' + value + ', ' + $('#...

jquery validate: adding a fade in/out effect to error messages

I'd like to add a fade-in/fade-out effect to the error messages displayed on jquery's validate. What's the way to do this? Could I use a div and on them and work them separately? Does the plugin include this effect? I'm using this code to place error messages (I need it for proper placing): $("#commentForm2").validate({ erro...

Detect :first-child support

How to detect, does browser support the CSS :first-child selector? ...

Page_load fires twice for UpdatePanel refresh whilst having a jQuery bound change event on a drop down list

I've tried to wrap up my problem with a complete example below - the original problem is part of a jQuery plug-in that I'm writing to extend the behaviour of an ASP.NET ajax application I already have. The aspx page below has one drop down list which is marked for auto post back. I've also bound a change event using jquery (which ultima...

JavaScript - Per each case, make array.

My last question asked for running once without the use of booleans. I decided I needed booleans but not a lot of variables since that would be messy. So let's say I have this: var counter = 0; $(function() { $('#typing').keyup(function() { switch($(this).val().toLowerCase()) { case 'test': // DO THIS...

Apply Css for elements even after postback-jquery

Hello Guys, I have many hrefs(with dynamic Ids) in my asp.net app that have the same CssClass=MyClass. I want these button to be hidden with a condition. I used the .ready $(document).ready(function() { if(condition) $('.MyClass').css("display","none"); }); the problem is docuement.ready doesn't execut when there is a poctba...

How do I remove all tinymce instances at startup?

I'm dynamically creating and destroying textareas for this purpose. However, when I create a textarea and then an instance of it in tinymce--then come back to the page again, it doesn't work. I've found that the solution is to simply remove any existing instance of that same name, but I was wondering if it's possible to just do it at sta...

2 jQuery events on same action seem to cancel each other

*Update: I have pasted working code in order to erase any ambiguity about what is going on. I have also tried to remove the preventDefault on both handlers, does not help I have a form where upon the button click, a JS event needs to happen, and the form needs to submit. As per the code below, what I thought would happen is: alert(but...

How can add Amazon Wish List to my site? (PHP, jquery, CSS)

Hiya, I want to add an Amazon Books Wish List to my site and I want to style it with CSS. So, how can I do it? Should I use PHP or can I use Jquery? Do you know PHP tutorials for it or any Jquery plug in? Thanks ...

Making sense of jquery - constructor error?

I'm pretty new to javascript, and has built a script that is working in webkit but not in firefox. When i check for errors in firebug, I get this: google.maps.Geocoder is not a constructor $('.to, .from').geo_autocomplete(new google.maps.Geocoder, { what does it mean? ...