Results 1 to 4 of 4

Thread: Create php alert pop ups using javascript.

  1. #1
    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

  2. #2
    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");
    }

  3. #3
    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.

  4. #4
    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!

Similar Threads

  1. How to use javascript to create HTML and CSS
    By KennedII in forum Software Development
    Replies: 5
    Last Post: 23-02-2010, 12:10 AM
  2. Alert function not working in Javascript
    By Calum in forum Software Development
    Replies: 5
    Last Post: 23-01-2010, 06:33 PM
  3. Create A Clock With Javascript
    By Sheenas in forum Software Development
    Replies: 5
    Last Post: 20-01-2010, 02:48 PM
  4. Javascript- Prompt, Alert and Confirm Box example
    By Javiier in forum Software Development
    Replies: 3
    Last Post: 08-12-2009, 03:20 AM
  5. JavaScript - How to create Element
    By Xylina in forum Software Development
    Replies: 3
    Last Post: 04-06-2009, 05:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,500,148.32104 seconds with 17 queries