...

View Full Version : alert box in javascript



rufaspa
09-30-2012, 10:23 PM
hello everyone,
can anyone please help me build a alert box with the following.

i have got a basic one which opens when my website is opened but i would like have something like when they click ok button then the offer page opens and when they click cancel then they remain to the same page.

i have a box on this website if you want to see my work www.rufaspa.co.uk please help on how to do the coding. many thanks

below is the code i used .
<html>
<body>
<script type="text/javascript">alert('Special Offer\n\nPamper Party Package\nOne Full Treatment + 2 Mini Treatments \n\nOnly 15* Each Person \n\n Book Now Email:- info@rufaspa.co.uk Call :- 07799 670 973 \n\n\n Check out our Special offer List on www.rufaspa.co.uk ');</script>
</body>
</html>

mlseim
10-01-2012, 02:49 AM
I would create a <div> on your page that contains the HTML, graphics, content, links, etc.

In your CSS stylesheet, you start out with that <div> hidden.
display:none; keeps it hidden from view.

#special{
width:400px;
height:300px;
display:none;
}

In your page you have:

<div id="special">
Visit today for specials on blah blah blah.
</div>

Then you put this on the top of your page (in the <head> section) so that <div> appears when the page loads.

<script src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#special').fadeIn(1500);
});
</script>

You also need to go to JQuery website and download the latest JQuery javascripting.
Put that .js file in the same directory as your page (or wherever you decide).

Using JQuery allows you to do many things, such as fade the <div> into view,
fade it back out, etc.


.

rufaspa
10-11-2012, 02:26 PM
i am not very good at all this. kindly give me the whole code so i can just copy and paste on my website .. sorry for using your time thank u

DanInMa
10-11-2012, 04:00 PM
i am not very good at all this. kindly give me the whole code so i can just copy and paste on my website .. sorry for using your time thank u

if you need someone to write an entire solution for your commercial website, you may want to head over to the job hiring forums.

rufaspa
10-11-2012, 08:03 PM
can anyone just help me with a few codes to add on this script please.

all i want is when someone clicks ok button then my offers page opens and if they click cancel then they remain on my homepage. not much asking .. plz help

please just edit the code below to my request.


<html>
<body>
<script type="text/javascript">alert('Special Offer\n\nPamper Party Package\nOne Full Treatment + 2 Mini Treatments \n\nOnly 15* Each Person \n\n Book Now Email:- info@rufaspa.co.uk Call :- 07799 670 973 \n\n\n Check out our Special offer List on www.rufaspa.co.uk ');</script>
</body>
</html>

Philip M
10-11-2012, 08:24 PM
please just edit the code below to my request.



Here you are. But if you know nothing about coding you should do what you would do in any other situation where you needed expert assistance - hire a professional. Why not the person who created your website? Presumably you would not attempt to service or repair a machine or appliance without any experience or understanding of how it worked.


<script type="text/javascript">

var c = confirm ('Special Offer\n\nPamper Party Package\nOne Full Treatment + 2 Mini Treatments \n\nOnly 15* Each Person\n\nBook Now Email:- info@rufaspa.co.uk Call :- 07799 670 973 \n\n\nCheck out our Special offer List on www.rufaspa.co.uk ');
if (c) {
window.location.href = "http://www.rufuspa.co.uk/specialofferpage.html"
}

</script>

Alert and confirm boxes are in effect obsolete and are seen nowadays as very primitive methods of communicating with the user. Ask a professional to do the job properly.

rufaspa
10-13-2012, 01:36 AM
thank you very much....

your a genius ...

business isnt tht good so can not afford to hire a programer thts why trying to do as much as i can.
but thnx alot for your help.. much appreciated



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum