Pop-under code

How can I modify the following "Open a new window on page unload" code to make the window load under the main page.

<body onUnload=window.open('http://www.domain.com'); self.blur();>
cayiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BatalfCommented:
You should put in

opener.focus() in the popup window.
0
COBOLdinosaurCommented:
<body onUnload="x=window.open('http://www.domain.com'); x.blur();self.focus();>

Cd&
0
brunoCommented:
blah - please don't do that.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

COBOLdinosaurCommented:
Its okay bruno FF will block it for you. ;^)

Cd&
0
cayiAuthor Commented:
Could U add a cookie code, please
0
brunoCommented:
true - although a popup did get thru firefox the other day...  :-/
0
COBOLdinosaurCommented:
cayi,

See:
http://www.experts-exchange.com/help.jsp#hi107

Post an absolute minimum points question... has a grading history where A is awarded only 30% of the time (site average is 75%);  then you want to ignore the guidelines and ask a totally unrelated question. If it was not for your grading history, I might respond to that, but as part of your education about how the site works you need to understand, that your history travels with you; and you've not been doing much to gain friends among experts.

Cd&
0
cayiAuthor Commented:
Dear coboldinaur:

First off, English is not my first language, so you may find my posts not up to your spectations,
I write in the same style to other people and They don't get annoyed.
I used to  gradually raise points If I had more. In my grading history, you'd see that most of the time I've awarded more than 20 pts
So You see that this time I'm offering just 20. that is because I've used up all my points.
Often times I don't get a solution, and even so, I had never given below B.
0
COBOLdinosaurCommented:
>>First off, English is not my first language, so you may find my posts not up to your spectations,
>>>I write in the same style to other people and They don't get annoyed.

I don't see anywhere in this thread where you posting style or command of English was criticized or even mentioned

>>>I used to  gradually raise points If I had more. In my grading history, you'd see that most of the time I've awarded more than 20 pts
So You see that this time I'm offering just 20. that is because I've used up all my points.

I already knew that.  I am and editor so I can see more in a profile then the average expert.  That is way I posted a response without pointing out the low points.  The low points did not become an issue until you oversteped polite behaviour you should exhibit when getting a free service.

You got a response to your question in 3 minutes.  You had resonses in 18 minutes.  You then ignored those response for a full day before you finally came back to the question.  So did you come back and sya that worked?  Did you indicate that it had a problem?  Did you even acknowledge that somehad taken the time to respond?  No, no, and no. What you did was come back and ask another question, that is not related to the original.  That cannot be described as anything but rude and insulting.  I don't care what your first language is, or what culture you are from; I don't know of any language or culture where the concept of saying "thank you" is unknown.

>>>Often times I don't get a solution, and even so, I had never given below B.

I looked through a lot of your questions, you are not grading the solutions.  You are grading how well your expectations are met.  The experts are not here to make you happy and come up to your expectations.  They try to give as much help as possible, and when your expectations exceed what is possible, they still deserve A it they give an A answer even it the answer only comes up to a B on your expectation scale.

I'm going to give you the basic cookie code from my hard drive.  I'm also going to give you some advice.  If you expect to keep getting help on this site you need to re-assess the way you are using it.  Most experts are not going to take the time explain the way I have; they are just going to ignore you.  From what I can see top-experts are not posting to your questions. Keep antaganizing experts with your behaviour/attitude and sooner it won't just be top-experts ignoring you; you won't get any help at all.

Here's the cookie code... don't expect any followup support for it:

basic cookie functions:

// get the cookie data

function cookieGET(Cname)
{
   var search = Cname + "=";
   if (document.cookie.length > 0)
   {
      RelPos = document.cookie.indexOf(search);
      if (RelPos != -1)
      {
         RelPos += search.length;
         RelEnd = document.cookie.indexOf(";", RelPos);
         if (RelEnd == -1)
         {
            RelEnd = document.cookie.length;
            alert(unescape(document.cookie.substring(RelPos,RelEnd)));
            return unescape(document.cookie.substring(RelPos,RelEnd));
         }
      }
   }  
}  
// Setup the cookie for update

function cookieSET (Cname,Ccontent,expiry,Cpath,Cdomain,security)
{
   var myCookie = Cname
       + "="
       + escape (Ccontent)
       +  ((expiry) ? "; expiry="
       + expiry.toGMTString() : "")
       +  ((path) ? "; path=" + Cpath : "")
       +  ((Cdomain) ? "; domain="
       + Cdomain : "")
       +  ((security) ? "; secure" : "");
   document.cookie = myCookie;
}

//  remove an existing cookie

function delCookie(Cname,Cpath,Cdomain)
{
   if (getCookie(Cname))
   {
     document.cookie = Cname + "="
     +  ((path) ? ";Cpath="
     + path : "")
     +  ((Cdomain) ? ";domain="
     + Cdomain : "")
     +  ";
     expires=Thu, 01-Jan-70 00:00:01 GMT";  
     alert(name+' setup for deletion');
   }


//     to set a cookie with no expiry
setCookie('anameforit','datacontent');


with expiry:

currentDT = new Date();
expiryDT = new Date(CurrentDT.getTime() + (90 * 86400000));
/ this sets and expiryDT of 90 days

setCookie('anameforit','datacontent',expiryDT);

Cd&  


0
cayiAuthor Commented:
>>First off, English is not my first language, so you may find my posts not up to your spectations,
Actually I'm still learning so it's not the best.

>I don't see anywhere in this thread where you posting style or command of English was criticized or even mentioned
I could get a hint that I was abrupt in my response, and I admit it but forgive me because at least I said "please" in here:
Could U add a cookie code, please


> So did you come back and sya that worked?
Sorry, I forgot to tell that I was yet to make certain it worked. I was still testing

>they are just going to ignore you.  From what I can see top-experts are not posting to your questions
Unfortunately yes, because I feel that they often do not find any coherence in my posts, and thus they are ignoring me.
t's my fault. But I see that experts are always there to help as in my other questions regardless, and even if they are busy or
not responding,  it helps me because their silence gives me a signal that I should rectify that
I was kind of rude or not clear on my message, so I think of them as well educated people with strong character like yourself.
 

I Will get back in a few days, to post my results with the cookie code. It will be before the end of the next weekend.
I need much time to do this. so I hope you'd still be here
If you still find this post a bit rude, just tell me. There's a lot for me to learn from you

Regards.

Viki Wong



0
cayiAuthor Commented:
From now on I'd give only an A Grade.
I hope it won't come as not appropiate either.
0
COBOLdinosaurCommented:
>>> From now on I'd give only an A Grade.

You don't need to do that, but if the experts have made a good faith effort and given the answer; which may not always be what you want to hear, then it should deserve an A.  If it looks like you are not quite to a solution, then before you grade see it the experts are sure that they have given you as much as possible.

I don't have any problem understanding your questions.  Your English is much better than a lot members, who I have helped.  The key is just to keep a dialog going.  As long as you stay active in a question the experts will generally continue to work on it.  Sometimes there are delays in responses because we are scattered all over the world, but as long as there is continuing contact, the threads will move along.  If an expert does not understand you they will let you know, and if you don't understand something you should let that be known as well.  It's an international site, and part of the challenge of that is we have to work through communication problems sometimes.

Cd&
0
COBOLdinosaurCommented:
BTW,

Don't raise the points any further, you might need to ask another question at some point so you should try and let them build up a little.  I don't do this for points... I just like to try and help people.

Cd&
0
brunoCommented:
btw - you can purchase points through EE you don't have to wait for the free ones to build up.
0
cayiAuthor Commented:
I'm back.

To Cd&:

Just to make sure:
Does the section after the line that reads "with expiry" is all that's  needed to set the cookie for "once per unique visitor or browser session"  Or the popup will only work when putting the entire code functions(// get the cookie data, // Setup the cookie for update, etc)

I'd put this between the <head></head> tags. Is that correct? If I'd like to set a expiry date of 1 day, I'd replace 90 with 1 and leave this code as it is:

currentDT = new Date();
expiryDT = new Date(CurrentDT.getTime() + (90 * 86400000));
/ this sets and expiryDT of 90 days

setCookie('anameforit','datacontent',expiryDT);



0
COBOLdinosaurCommented:
Yeah the one day expiry is what you want and so you just use the get cookie and it is not there the have not visited that day and then use the set cookie to put it out there.

Cd&
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cayiAuthor Commented:
Ok thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.