Feb 29

Most 5 features jquery newbies should learn

Posted By Ahmed El-Kilani On 29 Feb 2008 No Comments »
Here are the most top 5 brillant features of jquery, that a jquery-newbie should know:

1- Switching between DOM elements and jQuery:
To convert your jquery object to DOM element just use the indexer like the following since jquery object contains an array of matched elements:
    $('#elementid')[0].innerHTML = "New data";
    
On the contrary you can convert the DOM element to jquery using $() function:
    $(document.getElementById('elementid')).html("New data");
    
2- Filters:
    $(':hidden').show(); // Show all hidden elements
    if($('#elementid').is(':visible'))$('#elementid').hide(); // Hides an element if it is visible
    $(':empty').remove(); // Remove all emty elements
    $("table1 tr:first").css("font-style", "italic"); //Find the first row of table1
    $("table1 tr:last").css("font-style", "italic"); //Find the last row of table1
    
3- each method:
Loops DOM elements inside a jquery object since jquery object contains an array of DOM elements:
    //Display a warning if any input field is empty
    $('input[type=text]').each(function(){
    if($(this).val() == '')alert(this.id + " is empty!");
    });
    
4- trim whitespace:
var trimmed = $.trim(" Text to be trimmed ");

5- Inserting elements inside/outside other elements:
With jquery creating elements on the fly, inserting, removing or replacing them are much easier:
append() : append an element right after the last element inside the given element:
$('#container').append("<div>A new child</div>");
prepend() : append an element right before the first element inside the given element:
$('#container').prepend("<div>A child at the first order</div>");
after() : append an element right after the given element:
$('#elementid').after("<div>A new nextsibling element</div>");
before() : append an element right before the given element:
$('#elementid').before("<div>A new previoussibling element</div>");
replaceWith() : replaces and element with another:
$('#elementid').replaceWith("<div>Element to replace</div>");

Feb 10

Microsoft SQL Server 2008 has started out new technologies which aid to imporve performance, security, scalability, developer productivity and more..
New features and enhansments include environment enhancment, services, ADO .Net and Linq integration, and also T-SQL improvements.

Most significant new features:

  • T-SQL Intellisence
  • Filestreaming support (more..)
  • Data Encryption
  • Plan Freezing
  • Compression features (more..)
  • Backup Compression.
  • Performance improvment and enhancements.
  • ADO .Net object services.
  • Synchronous net-changes change tracking.
    See more at microsoft's ...

T-SQL enhancements:

  • += operator.
  • Insert multiple records (insert t values (@x), (@y))
  • MERGE statement (Merges data between two tables)
  • UPSERT statement (Used to update records if exist or insert if new)

and other wonderful features..

New data types:

  • DATE (Stores only date value)
  • TIME (Stores only time value)
  • DATETIME2 (Increased second and years range of the existing datetime)
  • DATETIMEOFFSET (Indicating the time zone that time blogs to)
  • FILESTREAM
  • HIERARCHYID (For working with hierarchical data)