?
Solved

Pop-under code

Posted on 2005-03-04
17
Medium Priority
?
178 Views
Last Modified: 2010-04-06
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();>
0
Comment
Question by:cayi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 3
  • +1
17 Comments
 
LVL 32

Expert Comment

by:Batalf
ID: 13463557
You should put in

opener.focus() in the popup window.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13463645
<body onUnload="x=window.open('http://www.domain.com'); x.blur();self.focus();>

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 13464536
blah - please don't do that.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13466319
Its okay bruno FF will block it for you. ;^)

Cd&
0
 

Author Comment

by:cayi
ID: 13467732
Could U add a cookie code, please
0
 
LVL 18

Expert Comment

by:bruno
ID: 13467795
true - although a popup did get thru firefox the other day...  :-/
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13467814
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
 

Author Comment

by:cayi
ID: 13469078
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13470995
>>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
 

Author Comment

by:cayi
ID: 13473693
>>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
 

Author Comment

by:cayi
ID: 13473800
From now on I'd give only an A Grade.
I hope it won't come as not appropiate either.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13476686
>>> 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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13476704
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
 
LVL 18

Expert Comment

by:bruno
ID: 13476767
btw - you can purchase points through EE you don't have to wait for the free ones to build up.
0
 

Author Comment

by:cayi
ID: 13489662
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
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 120 total points
ID: 13491171
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
 

Author Comment

by:cayi
ID: 13492350
Ok thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question