tags:

views:

440

answers:

6

The question says it all. :)

A: 

I believe that this tutorial on jQuery has an example that might help you: http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery

Guy
A: 

Here's an example in Prototype:

var my_div = document.createElement('div');

document.body.appendChild(my_div);
Mark Biek
A: 

A more specific question might give more helpful results, but here's a simple pair of snippets that shows and later updates text in a status container element.

// give some visual cue that you're waiting
container.appendChild( document.createTextNode( "Getting stuff from remote server..." ) );

// then later...        
// update request status    
container.replaceChild( document.createTextNode( "Done." ), container.firstChild );

harpo
+4  A: 

Here is a short pure-javascript example. Assume you have a div with the id "maincontent".

var newnode = document.createTextNode('Here is some text.');
document.getElementById('maincontent').appendChild(newnode);

Of course, things are a lot easier (especially when you want to do more complicated things) with jQuery.

Neall
A: 
<html>
    <head>
    <title>Font Detect please</title>

    <script src="prototype.js" type="text/javascript"></script>
    <script type="text/javascript">
        $('Myanmar3').update('False');         
        $('Myanmar3').innerHTML;        
    </script>
    </head>
    <body>  

     <table border="1">
        <tr><td>Font</td><td>Installed</td></tr>
        <tr><td>Myanmar3</td><td id=Myanmar3>True</td></tr>
        </table>     

    </body>
</html>

I have a simple code like that above and am trying to change the result True to false via Javascript using Prototype. What might I be doing wrong?

Edit: Got it. I didn't call it. :D

Ravi Chhabra
+1  A: 

@Ravi

Here's working example of your code

<html>
    <head>
    <title>Font Detect please</title>

    <script src="prototype.js" type="text/javascript"></script>
    <script type="text/javascript">
        function changeTD()
        {
            $('Myanmar3').innerHTML = 'False';         
        }
    </script>
    </head>
    <body>              

        <table border="1">
        <tr><td>Font</td><td>Installed</td></tr>
        <tr><td>Myanmar3</td><td id="Myanmar3">True</td></tr>
        </table>        

        <a href="javascript:void(0);" onclick="changeTD();">Click Me</a>

    </body>
</html>

You'll notice that I added a little link that you have to click to actually make the change. I thought this might make it easier to try out for real.

Mark Biek