jquery

.html() jQuery method bizzare bug -   resolves to empty space locally, but not on production.

I'm making a simple jquery command: element.html("                 "); using the attributes/html method: http://docs.jquery.com/Attributes/html It works on my local app engine server, but it doesn't work once i push to the google server. The element empties, but doesn't fill with spac...

Is encrypting AJAX calls for authentication possible with jQuery?

I'm fairly new to the AJAX methodologies (I only recently discovered jQuery a short time ago). I am interested to know if there is anyway to authenticate a user on a PHP setup; securely. Does jQuery have any special options to allow use of HTTPS (or any other way to encrypt my ajax call)? Yes, I could very well just post data back to t...

Integrating jQuery into an existing ASP.NET Web Application?

Microsoft recently announced that the Javascript/HTML DOM library jQuery will be integrated into the ASP.NET MVC framework and into ASP.NET / Visual Studio. What is the best practice or strategy adopting jQuery using ASP.NET 2.0? I'd like to prepare a large, existing ASP.NET Web Application (not MVC) for jQuery. How would I deal with ve...

JQuery Flickr file upload not working

I am trying to upload a file using to Flickr using JQuery. I have a form (which works if I dont use JQuery) which I am submitting using the Form Plugin. My code is as follows: <html> <head> <title>Test Upload</title> <script type="text/javascript" src="jquery-1.2.6.js"></script> <script type="text/javascript" src="jquery.form.js"></scr...

Why is the fact that Microsoft decided to support jQuery such a big deal ?

I don't see what all this fuss is about Microsoft's decision to support JQuery within ASP.NET MVC. There were signs that open-minded people are starting to have some say in the matters of marketing for a while now. And even the way MS does business has started to change. But at it's core it's still acting in response to customers' reque...

Check if option is selected with jQuery, if not select a default

Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected. (The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :) ...

Use jQuery to send Excel data using AJAX

I have the following function that is pulling data from a database. The ajax call is working correctly. How can I send the tab delimited data in my success function to the user? Setting the contect type to "application/vnd.ms-excel" didn't work. The alert on success shows the correctly formatted data. function SendToExcel() { ...

Regular expression to match non-english characters?

What is the easiest way to match non-english characters in a Regex? I would like to match all words individually in an input string, but the language may not be English, so I will need to match things like ü, ö, ß, and ñ. Also, this is in javascript/jquery, so any solution will need to apply to that. ...

Exception Thrown Causes RunTime Error.

We have developed a website that uses MVC, C#, and jQuery. In one of my controller classes we are validating inputs from the user and if it fails we throw an exception that the Ajax error parameter(aka option) handles. (We use Block UI to display the error message. BlockUI is a jQuery plugIn that blocks the screen and displays a message...

Problems using jeditable and autogrow

I work on a Webproject using jQuery and CakePHP. I use jeditable as an inplace edit plugin. For textareas I extend it using the autogrow plugin. Well, I have two problems with this: First, autogrow does only work on Firefox, not on IE, Safari, Opera and Chrome. Second, I need a callback event for jeditable, when its finished showing t...

Using jQuery to Highlight Selected ASP.NET DataGrid Row

Hi, It is easy to highlight a selected datagrid row, by for example using toggleClass in the tr's click event. But how best to later remove the highlight after a different row has been selected? Iterating over all the rows to unhighlight them could become expensive for larger datagrids. I'd be interested in the simplest solution, ...

How to detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this possible with jQuery? $("#menuscontainer").clickOutsideThisElement(function() { // hide the menus }); ...

jQuery index selectors

I'm trying to place 4 of my image containers into a new pane, having a total of 16 images. The jQuery below is what I came up with to do it. The first pane comes out correctly with 4 images in it. But the second has 4 images, plus the 3rd pane. And the 3rd pane has 4 images plus the 4th pane. I don't know exactly why the nesting is ...

JQuery Datepicker with text input that doesn't allow user input.

How do I use the JQuery Datepicker with a textbox input: $("#my_txtbox").datepicker({ // options }); that doesn't allow the user to input random text in the textbox. I want the Datepicker to pop up when the textbox gains focus or the user clicks on it, but I want the textbox to ignore any user input using the keyboard (copy & paste,...

How do I reference the calling dom element in a jquery ajax success function?

I'm trying to modify the class of an element if an ajax call based on that element is successful <script type='text/javascript'> $("#a.toggle").click(function(e){ $.ajax({ url: '/changeItem.php', dataType: 'json', type: 'POST', success: function(data,text){ if(data.error=='') { if($(this).hasClass('class1')) { ...

JQuery Datepicker returned Date object type

What's the object type returned by Datepicker? Supposing I have the following: $("#txtbox").datepicker({ onClose: function(date){ //something } }); What is date? I'm interested in reading the date object from another Datepicker for comparison, something like: function(date){ oDate = $("#oDP").datepicker(...

jQuery match multiple attributes

I have the following markup, and I want to make the 'All' radio button checked. <ul> <li><input type="radio" value="All" name="Foo" />All</li> <li><input type="radio" value="New" name="Foo" />New</li> <li><input type="radio" value="Removed" name="Foo" />Removed</li> <li><input type="radio" value="Updated" name="Foo" />Update...

Loading XHTML fragments over AJAX with jQuery

I'm trying to load fragments of XHTML markup using jQuery's $.fn.load function, but it raises an error trying to add the new markup into the DOM. I've narrowed this down to the XML declaration (<?xml...?>) -- the view works if I return static text without the declaration. I don't understand why this would cause failure, or if the blame l...

jQuery: How to position one element relative to another?

I have a hidden DIV which contains a toolbar-like menu. I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them. Is there a built-in function which will move the menu DIV to the top right of the active (mouse hover) DIV? I'm looking for something like $(menu).position("topright", targetEl); ...

How to use JQuery UI datepicker with bgIframe on IE 6

I am trying to use the JQuery UI datepicker (latest stable version 1.5.2) on an IE6 website. But I am having the usual problems with combo boxes (selects) on IE6 where they float above other controls. I have tried adding the bgIframe plugin after declaring the datepicker with no luck. My guess is that the .ui-datepicker-div to which I a...