Active Name Version Description
Android An Open Handset Alliance Project
Axis2 1.3
CakePHP 1.2 Rapid Development Php Framework
CSS
Grails 1.x Groovy version of Ruby on Rails
Groovy 1.6 Object-oriented language alternative for Java platform
Hibernate v3 High performance object/relational persistence and query service
HTML 4.x
Java 6 6
Java EE 5 5
Javascript Javascript functions, classes, event handlers
jQuery The Write Less, Do More, JavaScript Library
JSON Java JSON in Java from json.org
MySQL
Perl 5.10.0
PHP 5.x
Prototype A widely used JavaScript Framework
Python 2.5
Python C 2.5
Python Lib 2.5
Rails 2.3.5 A framework for developing web applications according to MVC
Ruby 1.8.7 A dynamic, interpreted, open source programming language
SiteMesh
Spring Framework 2.5 Full-stack Java/JEE application framework
Struts 2 2.0.11.2
Trails Core 1.2.1 Domain driven development framework in the spirit of Ruby on Rails
Trails Hibernate 1.2.1
Trails Security 1.2.1
Trails Test 1.2.1
Xerces2 J 2.9.1
Quick search is faster, or start browsing by clicking on API title
    Element.update - Prototype JavaScript framework

    update

    update(element[, newContent]) -> HTMLElement

    Replaces the content of element with the provided newContent argument and returns element.

    newContent can be plain text, an HTML snippet, or any JavaScript object which has a toString() method.

    If it contains any <script> tags, these will be evaluated after element has been updated (Element.update internally calls String#evalScripts).

    If no argument is provided, Element.update will simply clear element of its content.

    Note that this method allows seamless content update of table related elements in Internet Explorer 6 and beyond.

    Examples

    
    <div id="fruits">carrot, eggplant and cucumber</div>
    

    Passing a regular string:

    
    $('fruits').update('kiwi, banana and apple');
    // -> HTMLElement
    $('fruits').innerHTML
    // -> 'kiwi, banana and apple'
    

    Clearing the element’s content:

    
    $('fruits').update();
    // -> HTMLElement
    $('fruits').innerHTML;
    // -> '' (an empty string)
    

    And now inserting an HTML snippet:

    
    $('fruits').update('<p>Kiwi, banana <em>and</em> apple.</p>');
    // -> HTMLElement
    $('fruits').innerHTML;
    // -> '<p>Kiwi, banana <em>and</em> apple.</p>'
    

    … with a <script> tag thrown in:

    
    $('fruits').update('<p>Kiwi, banana <em>and</em> apple.</p><script>alert("updated!")</script>');
    // -> HTMLElement (and prints "updated!" in an alert dialog).
    $('fruits').innerHTML;
    // -> '<p>Kiwi, banana <em>and</em> apple.</p>'
    

    Relying on the toString() method:

    
    $('fruits').update(123);
    // -> HTMLElement
    $('fruits').innerHTML;
    // -> '123'
    

    Finally, you can do some pretty funky stuff by defining your own toString() method on your custom objects:

    
    var Fruit = Class.create();
    Fruit.prototype = {
      initialize: function(fruit){
        this.fruit = fruit;
      },
      toString: function(){
        return 'I am a fruit and my name is "' + this.fruit + '".'; 
      }
    }
    var apple = new Fruit('apple');
    
    $('fruits').update(apple);
    $('fruits').innerHTML;
    // -> 'I am a fruit and my name is "apple".'