the Future of the Web
  • Home
  • Articles
  • Contact
  • jQuery 1.2 Notes

    Sep 11 2007

    Great news: jQuery 1.2 is out, and the heavily-awaited jQuery UI (an "official" replacement to Interface) will be out on Sunday.

    Be sure to have a read of the jQuery 1.2 release notes, but here are a few highlights that I can't wait to use:

    • Partial .load()

      If you want to load a whole web page with Ajax, but only want to cut out a portion of the page and stick it in to an element on your page, you can now do this:

      $('#stats').load('same_page.php #stats');
      

      This will make it really easy to refresh an element on the page without needing to change the server-side logic.

    • New Traversing Features

      Traversing and selecting remain the most powerful features in jQuery, and it'll be great to be able to use .andSelf() to include the original set when traversing, and .prevAll()/.nextAll() to select all the siblings to one side or the other.

    • New Effect Features

      There are a ton of new Effects features, but my favourite is probably .stop(), allowing us to finally stop animations. Together with the new :animated selector, it's trivial to stop all ongoing animations at once:

      $(':animated').stop();
      

      Some of the other Effects features have a lot of potential, like being able to use percents or animating by a relative amount (eg. add 100px).

      Extremely powerful is the new ability to write extensible animations. I assume they did this to ease in the development of jQuery UI, but this allows all of us to harness the power of jQuery animations to do anything we want! Okay I'm starting to drool...

    Oh, one more thing. If you're used to creating elements in jQuery like this:

    var link = $('<a>');
    

    then you need to stop using invalid HTML and either make it XHTML compliant or add a closing tag, otherwise it will break in Internet Explorer. This is true since jQuery version 1.1.4, and I've had to make a lot of changes in my code as a result.

    Now any of the following is okay:

    // okay, XHTML-style
    var xhtmllink = $('<a/>');
    
    // also okay, valid HTML style
    var htmllink = $('<a></a>');
    
    Tags: javascript jquery jquery1.2
    View 2 Comments | Add a comment
  • Comments

    1. Mauvis at 9:27pm on September 13, 2007

    I can't wait for the new jQuery UI!

    2. Asif at 12:19am on October 23, 2007

    Hi,
    I m trying following code using JQuery:
    function chk()
    {
    $.ajax({
        url: 'document.xml',
        type: 'GET',
        dataType: 'xml',
        timeout: 1000,
        error: function(){
            alert('Error loading XML document');
            return false;
        },
        success: function(xml){
        return true;
            // do something with xml
        }
    });
    }

    However when calling this function does not returns anything (true/false).
    Also inside jQuery success:function() we can not initialize any outside global variable.
    Please provide solution.

    Add a Comment

    Note: HTML tags and entities will be converted so that they are displayed as you type them. This means if you type in <em>, people will see <em>, and if you type &lt;em&gt;, people will see &lt;em&gt;.

  • Request a Quote

  • Jesse Skinner

    Jesse Skinner
    • About Me
    • Email Me
    • RSS Feed RSS Icon
    • @JesseSkinner
  • Recent Articles

    • jQuery Live Events
    • I need web developers
    • buttons need type="submit" to submit in IE
    • Win $200 in a Web Dev Writing Contest
    • Use Arrays in HTML Form Variables
    • 5 Reasons Freelancers Can Succeed in a Shrinking Economy
    • Keeping a Live Eye on Logs
    • Using PHP's empty() Instead of isset() and count()
    • Testing Web Pages with Lynx
    • Stop CSS Background Flickering in Internet Explorer 6
    • See All...
  • Categories

    • javascript (39)
    • links (21)
    • about (19)
    • web (14)
    • html (12)
    • server (11)
    • css (8)
    • browsers (8)
    • carnival (7)
    • work (6)
    • design (4)
    • seo (4)
    • ads (4)
    • standards (4)
    • events (4)
  • Older Articles

    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
    • April 2005
    • See All...
Copyright © 2010 The Future of the Web