Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13-04-2009
Member
 
Join Date: Apr 2009
Posts: 68
Create php alert pop ups using javascript.

Hello,

I am developing an application in PHP,in which i wanted to set an alert that displays an popup massage which suggest to visitors of my site to make my site their home page. For that i have decided to use Javascript.

Please help
Reply With Quote
  #2  
Old 13-04-2009
Member
 
Join Date: Dec 2008
Posts: 161
Re: Create php alert pop ups using javascript.

you can use a the <body onload="..."> event. in the BODY tag and then call the function from the javascript file to load, something like this:

Code:
<body onload="popup()">
The above code calls the function from the Javascript file or if you have it embedded in the webpages. The below code is what you need to open the page in the popup, this can be pasted into an external file which contains all the javascript or embedded.

Code:
function popup() {
    window.open("popuppage.html","Homepage","resizable=no,status=yes,scrollbars=yes,width=260,height=500");
}
Reply With Quote
  #3  
Old 13-04-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: Create php alert pop ups using javascript.

The JavaScript Alert is the simplest and the most often used of the three available JavaScript pop-up dialog boxes. It's one simple job is to display a message to the user. When the browser reaches the point in the script that triggers the Alert, the Alert popup box is displayed on the screen and all other operations are suspended until the user confirms they have read the message by clicking the 'OK' button. It is obviously useful for displaying a message to the user but it is also very useful for debugging JavaScript scripts. You place it inline in the script you are developing and use it to display the value of variables, form input fields, etc.

There are many different ways you can call an Alert but we are going to use a JavaScript link that calls a JavaScript function called 'javascript_alert_demo', which in turn will prepare and call the Alert built-in function. You should note that an Alert requires one argument (the message) and it returns no value.
Reply With Quote
  #4  
Old 13-04-2009
Member
 
Join Date: Dec 2008
Posts: 202
Re: Create php alert pop ups using javascript.

Following is the JavaScript popup window that has the following code:

Code:
<head>
<script type="text/javascript">
<!--
function myPopup2() {
window.open( "http://www.google.com/", "myWindow", 
"status = 1, height = 300, width = 300, resizable = 0" )
}
//-->
</script>
</head>
<body>
<form>
<input type="button" onClick="myPopup2()" value="POP2!">
</form>
<p onClick="myPopup2()">CLICK ME TOO!</p>
</body>
Now, that is a prime example of a worthless popup! When you make your own, try to have them relate to your content, like a small popup with no navigation that just gives the definition or explanation of a word, sentence, or picture!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Create php alert pop ups using javascript."
Thread Thread Starter Forum Replies Last Post
How to use javascript to create HTML and CSS KennedII Software Development 5 23-02-2010 12:10 AM
Alert function not working in Javascript Calum Software Development 5 23-01-2010 06:33 PM
Create A Clock With Javascript Sheenas Software Development 5 20-01-2010 02:48 PM
Javascript- Prompt, Alert and Confirm Box example Javiier Software Development 3 08-12-2009 03:20 AM
JavaScript - How to create Element Xylina Software Development 3 04-06-2009 05:06 PM


All times are GMT +5.5. The time now is 11:58 AM.