Search results for 'Dialog'. 1 post(s) found.
- 2009/08/22 Javascript Prompts
Javascript is also providing propmpt method for various purpose. This method will be very useful if you make AJAX application.
Follwing example will bring up a window asking the Question of your choosing, with a space for the viewer to answer. The second set of quotes allows you to enter a default answer. If you leave it blank, the viewer will just see an empty box ready to be typed in. This is usually done before the page loads, so that you can write the answer they give into your page.
<SCRIPT language="JavaScript">
<!--hide
var yourname= Prompt('Please enter your name, so you can get a special greeting', ' ');
if ( (yourname==' ') || (yourname==null) )
{
yourname="Dude";
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT language="JavaScript">
<!--hide
document.write("<CENTER><H1>Hello, " + yourname + " ! Welcome to My Page! <\/H1><\/CENTER>");
//-->
</SCRIPT>
</BODY>
<!--hide
var yourname= Prompt('Please enter your name, so you can get a special greeting', ' ');
if ( (yourname==' ') || (yourname==null) )
{
yourname="Dude";
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT language="JavaScript">
<!--hide
document.write("<CENTER><H1>Hello, " + yourname + " ! Welcome to My Page! <\/H1><\/CENTER>");
//-->
</SCRIPT>
</BODY>
Another posts included in "HTML, Javascript"
| Javascript Confirmation (0) | 2009/08/22 |
| Photo thumbnail viewer implement in javascript (0) | 2009/08/28 |
| To get web browser capability (0) | 2009/08/28 |
| How to know browser version in javascript ? (0) | 2009/08/22 |
| How to know the browser name in Javascript ? (0) | 2009/08/22 |
| Select All, None, Invert checkbox (0) | 2009/08/21 |
| Simple RSS Reader based on javascript (0) | 2009/07/01 |
| How to find the ip address of a client machine from a web application? (0) | 2009/03/21 |

Prev

Rss Feed