In any of your js source files or script tags, use this
Event.observe(window, 'load', function(evt) {
        //Code here
});

It sounds like you could benefit from basic Javascript instruction-- 
there are many ways of accomplishing the same thing without using  
Prototype; the advantage of this method is it's clean, easy to read,  
and won't step on other onload functions. Find a good book or online  
tutorial, and use it.

Please also look at the official doocumentation (prototypejs.org) or  
try a Google search.  In addition to the volumes of information on  
this question on the internet, it has been answered on this list  
multiple times too.

That's probably why no one answered your question the first time.



TAG

On Mar 26, 2007, at 11:52 AM, x-men wrote:

>
> hi
>
> i want show to user Prototype window  when my page load completely?
> please show me where can i use Prototype code in the html tag.
> please help me step by step because i am new in javascript and
> Prototype.
> thanks.
>
> example:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Untitled Document</title>
>     <!--  Prototype Window Class Part -->
>     <script type="text/javascript" src="../javascripts/prototype.js">
> </script>
>         <script type="text/javascript" src="../javascripts/
> effects.js"> </
> script>
>         <script type="text/javascript" src="../javascripts/window.js">
> </
> script>
>         <script type="text/javascript" src="../javascripts/
> window_effects.js"> </script>
>         <script type="text/javascript" src="../javascripts/debug.js">
> </
> script>
>
>         <link href="../themes/default.css" rel="stylesheet"  
> type="text/
> css"
>>     </link>
>
>         <link href="../themes/spread.css" rel="stylesheet" type="text/
> css"
>>     </link>
>
>         <link href="../themes/alert.css" rel="stylesheet" type="text/
> css"
>>     </link>
>
>         <link href="../themes/alert_lite.css" rel="stylesheet"
> type="text/
> css" >   </link>
>         <link href="../themes/alphacube.css" rel="stylesheet"
> type="text/
> css" >   </link>
>         <link href="../themes/debug.css" rel="stylesheet" type="text/
> css"
>>     </link>
>
>         <!--  Doc Part-->
>         <script type="text/javascript" src="js/application.js"> </
> script>
>         <link href="stylesheets/login.css" rel="stylesheet"  
> type="text/
> css"
>>     </link>
>
>         <link href="stylesheets/style.css" rel="stylesheet"  
> type="text/
> css"
>
>>     </link>
>
> </head>
> <body onload="">               <--- i think i am write some code here
> for call Prototype window
>
> <script>Application.addTitle('Open a simple window', 'open_window1')</
> script>
>
>         <div style="display:none" id="open_window1_codediv">
>           <xmp id="open_window1">
> var win = new Window({className: "dialog",  width:350, height:400,
> zIndex: 100, resizable: true, title: "Sample window",
> showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff,
> draggable:true, wiredDrag: true})
>
> win.getContent().innerHTML= "test"
> win.setStatusBar("www.test.com");
> win.showCenter();
>           </xmp>
>         </div>
>
>                 </body>
> </html>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to