/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] welcome back!! comeback again!!

hello!!

is it possible for a site to have a “welcome!!” text on the homepage on first visit.. then become “welcome back!!” when visited again by visitors??

if it is.. how can i do it???

also when a visitor leaves the site how can i say “come back again!!” in big shouts and seems to appear out of nowhere on the page where a visitor is leaving?? anyway to do this not by means of popups, coz popups can be blocked by browsers, can’t it??

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@cootheadApr 14.2006 — Hi there elainebludfairy,

and a warm welcome to these forums. ?

try this...
[color=navy] <br/>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;

&lt;style type="text/css"&gt;
&lt;!--
#welcome {
font-family:verdana,arial,helvetica,sans-serif;
font-size:16px;
text-align:center;
}
--&gt;
&lt;/style&gt;

&lt;script type="text/javascript"&gt;
&lt;!--
var state;
function setCookie() {
exp=new Date();
plusMonth=exp.getTime()+(31*24*60*60*1000);
exp.setTime(plusMonth);
document.cookie='Welcome='+state+';expires='+exp.toGMTString();
}
function readCookie() {
if(document.cookie) {
which=document.cookie.split('Welcome=')
if(which[1]=='old') {
document.getElementById('welcome').firstChild.data='welcome back';
}
}
else{
state='old';
setCookie();
}
}
onload=readCookie;
//--&gt;
&lt;/script&gt;

&lt;/head&gt;
&lt;body onunload="alert('please come back and see us again at...nnhttp://mysite.com')";&gt;

&lt;div id="welcome"&gt;welcome&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;[/color]

[i]coothead[/i]
Copy linkTweet thisAlerts:
@elainebludfairyauthorApr 14.2006 — ?

thank you!!

that was quick!!

i am warmed!! ?
Copy linkTweet thisAlerts:
@elainebludfairyauthorApr 15.2006 — er.. hello again coothead, also to all!!

that code is just what i needed.. i tried it on its own and yes its what i really need..

this may sound silly but i really have a hard time trying to insert it in my existing fla doc.. my understanding of codes were really low.. sorry ?

heres a sample of my fla doc.

[CODE]<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #CCCCCC;
background-color: #000000;
text-align: center;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('../Assets/images/nav_button/home_on.gif')">
<table width="100%" height="128" border="0">
<tr>
<td><div align="center"><img src="" alt="Flash Banner under construction!!" name="FlashBanner" width="780" height="128" id="FlashBanner" style="background-color: #333333" /></div></td>
</tr>
</table>
<table width="100%" height="48" border="0">
<tr>
<td align="center"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home image1','','../Assets/images/nav_button/home_on.gif',1)"><img src="../Assets/images/nav_button/home_off.gif" name="home image1" width="80" height="30" border="0" id="home image1" /></a> <div align="center"></div></td>
<td align="center"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home image2','','../Assets/images/nav_button/home_on.gif',1)"><img src="../Assets/images/nav_button/home_off.gif" name="home image2" width="80" height="30" border="0" id="home image2" /></a></td>
<td align="center"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home image3','','../Assets/images/nav_button/home_on.gif',1)"><img src="../Assets/images/nav_button/home_off.gif" name="home image3" width="80" height="30" border="0" id="home image3" /></a></td>
<td align="center"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home image4','','../Assets/images/nav_button/home_on.gif',1)"><img src="../Assets/images/nav_button/home_off.gif" name="home image4" width="80" height="30" border="0" id="home image4" /></a></td>
</tr>
</table>
<p><img src="sample1%20gif.GIF" width="30" height="41" />welcome!!<img src="sample1%20gif.GIF" width="30" height="41" /></p>
<p>&nbsp;</p>
<p>blah blah blah blah blah blah blah blah<br />
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah<br />
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah<br />
blah blah blah blah<br />
blah blah blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah</p>
<p>&nbsp;</p>
<p>Copyright &copy; 2006, Blah Blah</p>
</body>
</html>
[/CODE]

the gif images on the left & right of the word "welcome" is suppose to be moving.. but im still working on it to move :p !!

on first visit that portion's suppose to show --> <Gifimage>welcome!!<Gifimage>

on next next next visit --> <Gifimage>welcome back!!<Gifimage>

for the onunload part alert .. er.. i've been thinking.. what if i want it to appear when someone leaves that website not just the page?? say um i have many pages on that website and i dont want someone to get annoyed by that alert if it keeps appearing when they browse on my site..

hope i described my problem well this time.. and i hope i did it right with the code and the attachments..

help me please..

[upl-file uuid=73f9d2a2-41dc-425d-921a-4eea9f0a637b size=1kB]sample1 gif.GIF[/upl-file]

[upl-file uuid=c98a6913-ebd8-4ec2-8fda-463428d6a6ec size=1kB]home_off.gif[/upl-file]

[upl-file uuid=7ab78942-aab9-46f3-bacf-ca79d3a8d76a size=1kB]home_on.gif[/upl-file]
Copy linkTweet thisAlerts:
@elainebludfairyauthorApr 21.2006 — please help!! ..someone ..anybody
Copy linkTweet thisAlerts:
@cootheadApr 21.2006 — Hi there elainebludfairy,

sorry about this, I missed your previous post. :o

Try it like this...
[color=navy]
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;style type="text/css"&gt;
&lt;!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #CCCCCC;
background-color: #000000;
text-align: center;
}
--&gt;
&lt;/style&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&amp;&amp;i&lt;a.length&amp;&amp;(x=a[i])&amp;&amp;x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i&lt;a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))&gt;0&amp;&amp;parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i&lt;d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x &amp;&amp; d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i&lt;(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var state;
function setCookie() {
exp=new Date();
plusMonth=exp.getTime()+(31*24*60*60*1000);
exp.setTime(plusMonth);
document.cookie='Welcome='+state+';expires='+exp.toGMTString();
}
function readCookie() {
if(document.cookie) {
which=document.cookie.split('Welcome=')
if(which[1]=='old') {
document.getElementById('welcome').firstChild.data='welcome back';
}
}
else{
state='old';
setCookie();
}
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body onload="readCookie();MM_preloadImages('../Assets/images/nav_button/home_on.gif')"
onunload="alert('please come back and see us again at...nnhttp://mysite.com')"&gt;
&lt;table width="100%" border="0"&gt;&lt;tr&gt;
&lt;td&gt;&lt;div align="center"&gt;&lt;img src="" alt="Flash Banner under construction!!" name="FlashBanner" width="780" height="128" id="FlashBanner" style="background-color: #333333" /&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;table width="100%" border="0"&gt;
&lt;tr&gt;
&lt;td align="center"&gt;
&lt;a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home_image1','','../Assets/images/nav_button/home_on.gif',1)"&gt;&lt;img src="../Assets/images/nav_button/home_off.gif" name="home_image1" width="80" height="30" border="0" id="home_image1" alt="" /&gt;&lt;/a&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td align="center"&gt;
&lt;a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home_image2','','../Assets/images/nav_button/home_on.gif',1)"&gt;&lt;img src="../Assets/images/nav_button/home_off.gif" name="home_image2" width="80" height="30" border="0" id="home_image2" alt="" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;
&lt;a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home_image3','','../Assets/images/nav_button/home_on.gif',1)"&gt;&lt;img src="../Assets/images/nav_button/home_off.gif" name="home_image3" width="80" height="30" border="0" id="home_image3" alt="" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td align="center"&gt;
&lt;a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home_image4','','../Assets/images/nav_button/home_on.gif',1)"&gt;&lt;img src="../Assets/images/nav_button/home_off.gif" name="home_image4" width="80" height="30" border="0" id="home_image4" alt="" /&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;&lt;img src="sample1%20gif.GIF" width="30" height="41" alt=""/&gt;&lt;span id="welcome"&gt;welcome!!&lt;/span&gt;&lt;img src="sample1%20gif.GIF" width="30" height="41" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
blah blah blah blah blah blah blah blah&lt;br /&gt;
blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah
&lt;/p&gt;&lt;p&gt;
blah blah blah blah blah blah blah blah blah blah
&lt;/p&gt;&lt;p&gt;
blah blah blah blah blah blah&lt;br /&gt;
blah blah blah blah blah blah
blah blah blah blah blah blah
blah blah blah blah&lt;br /&gt;
blah blah blah blah&lt;br /&gt;
blah blah blah blah blah blah blah blah
&lt;/p&gt;&lt;p&gt;
blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Copyright &amp;copy; 2006, Blah Blah&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;
[/color]

coothead
Copy linkTweet thisAlerts:
@elainebludfairyauthorApr 21.2006 — dont be!!

thanks.. a million much!! ?
×

Success!

Help @elainebludfairy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...