| |
|
Welcome to AstaHost - Dear Guest | |
How To Create A Popup Window With Javascript?
#1
Posted 05 September 2004 - 06:28 PM
I want to in popup massage suggest to visitors of my site to make my site their home page .
Please note that I have some script code that visitors most click on a text to make my site their home page .
Every one that can help me please send an email to soleimanian@noavar.com
#2
Posted 06 September 2004 - 07:46 AM
http://www.berm.co.nz/popupmaker/.
Or you may want to download this free software that can help you make pop-ups:
http://www.codelifte.../pop5index.html.
Either way simply follow the instructions and you can get your pop-up very quickly.
#3
Posted 06 September 2004 - 11:28 AM
or you can use a the <body onload="..."> event.
#4
Posted 07 September 2004 - 01:36 PM
<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 as i said previously.
function popup() {
window.open("popuppage.html","Homepage","resizable=no,status=yes,scrollbars=yes,width=260,height=500");
}If you require any help or do not understand then ask
#6
Posted 12 September 2004 - 03:12 PM
#7
Posted 12 September 2004 - 04:47 PM
I would rahter just make a link that says "add this page to your favorites list!" or something like that.
#9
Posted 13 September 2004 - 02:32 AM
Will pop up dialog box asking if you would like to set http://www.yoursitehere.com as your homepage.
There is no standard so there are very few browsers it will work in.
I don't think NS has ever had support.
IE5 supported it but I am not sure if the syntax was the same.
#11
Posted 11 January 2006 - 04:20 PM
function popUp() {
alert("Please make my site your homepage!");
}
You just put the code above together with your other script code in the <script> tag -- that is within the <head> tag. How it works is that the "alert" function will pop up as an alert box and whatever message you want your site visitors to see first when they get to your site will be displayed in small pop-up window (AKA the alert box). In between the quotations within the parenthesis is what will appear in the alert box. I just put "Please make my site your homepage!" as an example but you can change that part of the message to whatever you want it to be.
And now, in the body tag, have the following:
<body onload="popUp()">
This code is as oveture explains. It will call the function called (well, in this case) "popUp()" and "onload" (which means that when your webpage loads), the function being called will be executed. So... if you don't have the "onload" function in the <body> tag, the script from how to pop-up a window will not work.
Okay, I hope that helps you out. A really simply code and I believe it fits what you are asking for. ^__^
Regards,
-- scryoko
#12
Posted 12 February 2006 - 11:19 PM
For example, if you want to have a pop-up on a page when someone enters it, use this code:
<script language="JavaScript type="text/javascript"">alert("Place your message here!")</SCRIPT>Or you can get one that pops up when someone leaves the page:
<body onunload="alert('Place your message here!');">Also, there is one when a visitor moves their pointer over a link:
<a href=""onMouseover="alert('Place your message here!')">Put the text you want to be visible here.</a>Or if you want something more cool, make one that says the time and date upon entering a page:
<script language="JavaScript" type="text/javascript">
document.write("Having a great day?")
document.write("<BR>")
document.write("Today's date is ",Date())
</script>Finally, you could use one that comes up when you enter and leave a page.
<body onload="alert('Place your message here!');"
onunload="alert('Place your second message here!');">
#13
Posted 14 February 2006 - 01:56 PM
if(!isAdded) { // use a var from a cookie to check wether your site is already added to favorites
if(question("Do you want to make my site your homepage") { // Ask to add this site
window.external.AddFavorite(location.href, document.title);
}
}I'm almost sure this isn't correct javascript and I don't know how to use cookies, so plz rewrite this code, but isn't this a nice idea instead of the popup?
-=jeroen=-
#14
Posted 14 February 2006 - 05:51 PM
NEVER EVER EVER EVER HAVE POP-UPS ON YOUR SITE TO ASK PEOPLE TO DO SOMETHING.
If they want to make your site part of their favourites, then they will do. If they want to make it their home page, then they will do. If they don't have the technical knowledge, then use simple inline javascript as well as a link to achieve the effect.
It is possible to create in document pop-ups, using AJAX, but I aint telling you how, as I do not know myself.
#16
Guest_FeedBacker_*
Posted 14 February 2008 - 08:00 PM
How To Create A Popup Window With Javascript?
<HEAD>
<!-- STEP TWO: Use the following button code for the new window -->
<form>
<input type=button value="Popup Window" onClick="javascript:popUp('This area please mention the your Folder or file')">
</form>
-Ganesh
#18
Guest_FeedBacker_*
Posted 09 April 2008 - 08:42 AM
How To Create A Popup Window With Javascript?
Hello friends,
I have one Query in javascript.. I call javascript function server side without any event fire like onblur,mouseover etc. And after the function then return server side..
Please help me this query
Regards,
Prashant
-reply by prashant
#19
Posted 15 April 2008 - 09:19 PM
You can simply put any Html code into the tag DIV and make this Div unvisible.
For example:
<body>
......
<DIV id="myTestDiv" style="left:-1000px;top:-1000px;disply:none;position:absolute;'>
<table border=1>
<tr>
<td>Menu Item 1</td>
</tr>
<tr>
<td>Menu Item 2</td>
</tr>
</table>
</DIV>
.....
</body>
When my popup window (created as Div element) is unvisible, I do not worry about its location on the screen - it does not matter. That's way I put negative values for top and left coordinates.
However, before visualing I should move it to appropriated location. It can be done by JavaScript using attribute style. For example, I can move my popup to any absolute location on current page:
<script language='javascript'>
function moveMyPopup() {
var mypopup = document.getElementById('myTestDiv');
mypopup.style.top = '25px';
mypopup.style.left = '100px';
}
</script>
After moving I can do it visible:
pop.style.display = '';
Or hide it again:
pop.style.display = 'none';
#20
Posted 16 April 2008 - 02:35 PM
Div elements are used very often for creating poipup menu on the first (main) page of Web sites.
But we have to keep in mind, that different browser have different Javascript systacsis for moving and hiding/showing elements on the screen.
Look at documentation attentively!
Edited by java-area, 16 April 2008 - 02:36 PM.
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











