jquery

Submit form using AJAX and jQuery

It seems like this should be something built into jQuery without the need for more than a few lines of code, but I can't find the "simple" solution. Say, I have an HTML form: <form method="get" action="page.html"> <input type="hidden" name="field1" value="value1" /> <input type="hidden" name="field2" value="value2" /> <sele...

clearTimeout on multiple setTimeout

Hi everyone, I have multiple setTimeout functions like this: function bigtomedium(visiblespan) { visiblespan.removeClass('big').addClass('medium'); setTimeout(function(){ mediumtosmall(visiblespan);},150); }; function mediumtosmall(visiblespan) { visiblespan.removeClass('medium').addClass('small'); setTimeout(function() { s...

jquery plugin for preventing entering any input not matching a regexp

does jquery have any plugin that prevents entering any input to a textbox that doesnt match a regexp pattern. for example , i have a textbox for entering payment amount, i want user t be able to enter only numebers and . in the textbox, all other input wont have any effect on the textbox.. thanks ...

jquery ajax request failing in IE

The following ajax call is failing in IE. $.ajax({ url:"{{SITE_URL}}/content/twitter.json", dataType:"json", error:function(xhr, status, errorThrown) { alert(errorThrown+'\n'+status+'\n'+xhr.statusText); }, success:function(json) { ...Snip... } }); The error function returns Undefined parsererror OK...

jquery behaves strangely in some sites when inserted via bookmarklet

I'm putting together a bookmarklet that inserts jquery into pages it is invoked on. On many pages it works just fine, but on pages like http://www.cnn.com (which includes both prototype and scriptaculous) it behaves a bit strangely. $(blah..).appendTo("body") does not work whereas $(blah..).appendTo(document.getElementsByTagName("body")...

How do I check a checkbox with JQuery or Javascript?

I want to do something like this $(".myCheckBox").checked(true); or $(".myCheckBox").selected(true); Is such a thing built into JQuery? To clarify, I wish to set the value. ...

What is the best way to call a .net webservice using jquery?

I'd like to call a .net webservice from another domain using only jquery. What is the best way to do this? and are there any configuration changes I need to be aware of on the web site hosting the web page? The reason I ask this, is that I am only marginally in control of that area. So I can only make limited changes. ...

Can I suppress the browser’s login prompt on 401 response when using XmlHttpRequest with Twitter

I'm using jQuery's ajax methods to interact with the Twitter REST API. Their API is a bit annoying, in that some actions will return a 401 HTTP status code. In that case, I just want it to fail, instead of displaying a login box. I've tried just providing an incorrect user:pass pair in the URL, in case that might suppress the dialog a...

Preload images for jQuery Cycle Plugin

Hi, I’m quite new to jquery and trying to figure out how to preload images for the jQuery Cycle Plugin. I have 5+ large size images and I need those to be preloaded before starting the slideshow with Cycle plugin. Also I need to display a loading gif wile it preloads the images. I have tried to implement the technique here http://jquer...

Is There Something Wrong with IE's CSS Top And Left?

The following jQuery code works just fine for me with Safari, Opera, FF2, and FF3. It positions a busy DIV (with an animated busy GIF) on top of a FORM element on my web page. The problem is that in IE6 and IE7, it gets width and height properly, but doesn't seem to get top and left properly. What's the catch? var nH = $('#' + sForm).at...

How to get jQuery to pass custom arguments to asynchronous AJAX callback functions?

My page deals with many "Store" objects, each of them has a field called 'data'. However, this data is fetched via AJAX requests which may be parallely going on. function Store(id){ this.id = id; this.queryparam = 'blah'; this.items = null; } Store.prototype.fetch = function(){ $.get("/get_items",{q:this.quaryparam},fun...

Browser version Detection

I have a spec in my current project that requires us to advise the user which browsers are best to use the web application. If their current browser version they are using is not in our list of "ideal" browsers we want to display a message. What is the best way to check a specific version of the users browser. I am aware of the follow...

jquery toggle display

I'd like to create a list and be able to toggle the display of children items on click. Should be simple but i can't get it to work. Any thoughts? <script> $(document).ready(function(){ $("dt a").click(function(e){ $(e.target).children("dd").toggle(); }); }); </script> <style> dd{display:none;} </style> <pre> <dl> <dt><a hre...

Calling javascript function inside JQuery

Dear all I am using javascript and jQuery My Mainfile has My.js,and ajax. My.js has function build_one(){ alert("inside build_one"); } My Mainfile has <script type="text/javascript"> .. // here I want to make call function defined in My.js build_one() .. ...

Telerik UI controls vs client-side UI with jQuery

I am trying decide on how I want to handle the UI for an external-facing web app. Because it is external, latency caused by page bloat could be an issue. I have used jQuery some in the past, and I am evaluating the Telerik controls now. I have seen a lot of good recommendations on the Telerik controls, including some on StackOverflow. I...

Floating Too Far Right!

I've got a record management web application which displays a master record on one screen and AJAXes dynamically built editors into an editor div, which I've used JQuery to make draggable. That works. Even though the div isn't a window, I thought it might be a nice idea to make it act a bit more like one, so I coded in a "close" button....

web service being called twice with jquery ajax function

I am using the $.ajax function in jquery to make a call to an asmx service. When I look at the requests from fiddler, I see two requests for each call I make. One has a content type of text/html which of course returns a 401 not authorized status, and the other one has the correct content type and returns the correct data. Can anyone t...

jQuery: Color fade-rotate

I need a function that I can call when somthing is done, for example a fadeOut, fadeIn and so on... The function I need is a bg-color/font-color rotate with jQuery. I want it to fade betwen two colors for X seconds. Have used google with no result. ...

How to capture an event trigger when a flash movie successfully loaded?

I'm currently using jQuery, as well as swfObject to dynamically embed the swf movie into my web page. I currently having a problem on embeding immem's music player into my web page, as their embed code doesn't have any loading screen. So, when I replace the element using swfObject, that area will generally blank. In worst case, it means...

How to translate strings in JS

I have a project which I want to translate into multiple languages for the PHP Part I use Zend Frameworks Zend_Translate with GetText. Now I want to translate the JS part too. I am using the jQuery JS Framework and would love to hear your thoughts on translation for JS files ...