Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Monday, June 11, 2012

How can I convince IE to simply display application/json rather than offer to download it?


While debugging jQuery apps that use AJAX, I often have the need to see the json that is being returned by the service to the browser. So I'll drop the URL for the JSON data into the address bar.

Do you know of a bleeding-edge HTML5 leveraging, legacy-ignoring JavaScript framework?


What's the best framework (sort of jquery, extjs, etc like) to use if I'd like to intensively use all the freshest technologies of the HTML5 stack provided by modern browsers (Firefox 7, Safari 5, Chrome 14) and have absolutely no need to support any legacy browsers (incl. no need in IE support at all and no need in Firefox or Chrome prior to the latest stable releases)? I'd like to get all the newest available goodness without having (even abstracted by a library layer) a line of code meant just fore legacy compatibility or keeping any legacy-induced things in mind.

Getting the ID of the element that fired an event using JQuery


Is there any way to get the ID of the element that fires an event?

Which keycode for escape key with jQuery


I have two functions. When enter is pressed the functions runs correctly but when escape is pressed it doesn't. What's the correct number for the escape key?

jQuery lose focus event


I'm trying to show up a container if a input field gets the focus and - that's the actual problem - hide the container if focus is lost. Is there an opposite event for jQuery's focus?

Sunday, June 10, 2012

Changing the image source using jQuery


My DOM looks like this:




<div id="d1">
<div class="c1">
<a href="#"><img src="img1_on.gif"></a>
<a href="#"><img src="img2_on.gif"></a>
</div>
</div>

jquery live hover


I'm using the following jquery code to show a contextual delete button only for table rows we are hovering with our mouse. This works but not for rows that have been added with js/ajax on the fly...

What"s the best edit-in-place plugin for jQuery?


I need an edit-in-place plugin for jQuery but there are quite some around. I've been testing jeditable ( http://www.appelsiini.net/projects/jeditable ) but it lacks some basic options (like hover effect). I also found JEIP ( http://josephscott.org/code/javascript/jquery-edit-in-place/ ) which has recently been developed but comes with much more settings.

grid controls for ASP.NET MVC?


If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere?

Friday, June 8, 2012

jQuery Set Cursor Position in Text Area


How do you set the cursor position in a text field using jQuery? I've got a text field with content, and I want the users cursor to be positioned at a certain offset when they focus on the field. The code should look kind of like this:

How to "enable' HTML5 elements in IE that were inserted by AJAX call?


See the solution at the bottom of the question.



IE does not work good with unknown elements (ie. HTML5 elements), one cannot style them , or access most of their props. Their are numerous work arounds for this for example: http://remysharp.com/2009/01/07/html5-enabling-script/

Problems with jQuery getJSON using local files in Chrome


I have a very simple test page that uses XHR requests with jQuery's $.getJSON and $.ajax methods. The same page works in some situations and not in others. Specificially, it doesn't work in Chrome on Ubuntu.

$(document).ready equivalent without jQuery


I have a script that uses $(document).ready, but doesn't use anything else from jQuery. I'd like to lighten it up by removing the jquery dependency.

Thursday, June 7, 2012

Find text string using jQuery?


Say a web page has a string such as "I am a simple string" that I want to find. How would I go about this using JQuery?

Difference between jQTouch and jQuery mobile


What is the difference between jQTouch & jQuery Mobile Framework ?

How can jQuery deferred be used?


jQuery 1.5 brings the new Deferred object and the attached methods .when , .Deferred and ._Deferred .

$(document).ready equivalent without jQuery


I have a script that uses $(document).ready, but doesn't use anything else from jQuery. I'd like to lighten it up by removing the jquery dependency.

Getting jQuery to recognise .change() in IE


I'm using jQuery to hide and show elements when a radio button group is altered/clicked. It works fine in browsers like Firefox, but in IE 6 and 7, the action only occurs when the user then clicks somewhere else on the page.

Tuesday, June 5, 2012

Unobtrusive dynamic form fields in Rails with jQuery


I'm attempting to get over the hurdle of dynamic form fields in Rails -- this appears to be something the framework doesn't handle very gracefully. I'm also using jQuery in my project. I have jRails installed, but I'd much rather write the AJAX code unobtrusively where possible.

Monday, June 4, 2012

Facebook how to check if user has liked page and show content?


I am trying to create a Facebook iFrame app. The app should first show an image and if the user likes the page, he will get access to some content.