Ridding of double name in window.open

The script works fine for me (almost, see my other thread). However when it launches the new window it gets "http://www.mypage.com" infront of the window title that I have given it. I want my title to appear in a specific way and I'm picky. If I delete the text in the title tag the script doesn't work either, but I don't want to do that anyway (babbling, sorry).

My whole source is:

<<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<head>
     <title>&#58;&#58;&#32;&#32;andreasgustavsson.com&#32;&#32;&#58;&#58;</title>
     
     <script type='text/javascript'>
function SetWindow()
{
     url = "mainplayer.htm"              //Set address of new window
  var height = 600                       //Set height
  var width = 800                        //Set width
  var name = ""                          //Set window name
  var top = 200                          //Set distance from top
  var left = 200                         //Set distance from left
  newwin=window.open(url, name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
       // Cannot perform across all browsers
        //this.focus();
        //self.opener = this;
        //self.close();
     
}
</script>

</head>

<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" bgcolor="#000000">

<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
       <td align="center" valign="middle"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#3,0,0,0" width="550" height="400">
    <param name="src" value="flash/intro.swf">
      <param name="quality" value="high"
    <embed src="flash/intro.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/" type="application/x-shockwave-flash" width="550" height="400">
    </embed>
  </object></td>
</tr>
</table>


</body>

See http://www.andreasgustavsson.com/beta to see what I mean.

Cheers

/A
iamcmagAsked:
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.

archrajanCommented:
try this
<title style = "align:center">::andreasgustavsson.com::</title>
0
archrajanCommented:
if thats not what u want.. could you please explain a little more on what u r looking for?
0
archrajanCommented:
see this
STEP 1.
Inserting the <script> in your page

Put the following <script> </script> in the head
section of your launching page.  

Set the variables as indicated in the script.

<script>

// Amazing Frameless Popup Window - Version I
// (C) 2000 www.CodeLifter.com
// Free for all users, but leave in this  header

// set the popup window width and height

var windowW=214 // wide
var windowH=398 // high

// set the screen position where the popup should appear

var windowX = 260 // from left
var windowY = 100 // from top

// set the url of the page to show in the popup

var urlPop = "yourpage.html"

// set the title of the page

var title =  "This Is A Frameless Popup Window"

// set this to true if the popup should close
// upon leaving the launching page; else, false

var autoclose = true

// ============================
// do not edit below this line
// ============================

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openFrameless(){
  if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)    
    NFW.blur()
    window.focus()      
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }  
  NFW.focus()  
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

</script>

==============================================================

STEP 2.
Triggering the popup window

Call the openFrameless function from a link, like this:

<a href="javascript:openFrameless()">click here</a>

==============================================================

STEP 3.
Conditioning the page that goes in the popup window

Add the following call to the <body> tag of the page that
will open in the popup *if* your popup does not come to the
front after it loads.  This is occasionally needed in early
versions of IE4, and with certain types of page content that
manipulate focus. If in doubt, put it in -- it can't hurt.

<body onload="top.window.focus()">

==============================================================

ADDENDUM 2/22/2001
Making the Frameless Popup Center on the Screen Automatically

We've had numerous requests for this, and a minor modification
of the script can do it.  Here's how...

Comment out the two lines as shown, and add the two shown below
them.

// set the screen position where the popup should appear

//var windowX = 260 // from left
//var windowY = 100 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);

==============================================================
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

devicCommented:
try window.title

e.g.:
newwin=window.open(url, name......
newwin.title="&#58;&#58;&#32;&#32;andreasgustavsson.com&#32;&#32;&#58;&#58;"
0
GwynforWebCommented:
<script>
  win=window.open('','','height=300,width=700')
  win.document.title="::andreasgustavsson.com::"
</script>
0
iamcmagAuthor Commented:
I will get back to you gyus with trying your ideas and giving you the points as soon as I can. I'm just a bit pre-occupied at the moment, things got in my way.
I'm really glad to see that many good advice though.

Thanks for now.
0
iamcmagAuthor Commented:
Okay I'm back sorry for the long delay.
I've tried all of the above examples, they are all good suggestions. However they all have the same problem, I'm getting the url in front of the name on the titlebar. After trying around I can't get my original script to care for the name var at all, it just adds the url and then reads the title from head/title tag. I thought that it was solved when I tried GwynforWebs suggestion, it looked fine locally but as soon as you add the url of the page to load it has the same problem. There must be a way around this.

Again check my web site to see the problem.
http://www.andreasgustavsson.com/beta

I must also say thank you to archrajan for the well explained script, unfortunately it rendered the same problem.

Grateful for more suggestions.
0
iamcmagAuthor Commented:
To GwynforWeb or someone else:

What does the second parameter specify, isn't that the name? If I put something there in qoutation marks it igonres it, but if try to give it a var the window doesn't open.

This works (but renders the old problem):
var path="mainplayer.htm"

win=window.open(path,'','height=600,width=800');

This works (but ignores the string and renders the old problem):
var path="mainplayer.htm"

win=window.open(path,"Test",'height=600,width=800');

This doesn't work:
var path="mainplayer.htm"
var name="test variable"

win=window.open(path,name,'height=600,width=800');
0
yourbudweiserCommented:
Try this:

PAGE1.HTM
--------------
<script language="javascript">
/* Open window*/
 var windowHandle = '';
 function openSesame(url,name,attributes) {
 windowHandle = window.open("page2.htm?"+escape(url),name,attributes);
}
</script>

<a href="javascript:openSesame('faq.htm','Search','toolbar=no,resizable=yes,scrollbars=yes,width=200,height=200');">Open Sesame</a>


PAGE2.HTM
--------------
<head>
<title>Put Your Title Here</title>
</head>
<script>
document.write('<frameset rows="100%,*"><frame src="'+unescape(location.search.substring(1))+'"></frameset>')
</script>
</html>

Good luck!
YBW
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
Michel PlungjanIT ExpertCommented:
      
var windowHandle = '';
var height=600;
var width=800;
//var left=200;
//var top=200;
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);

      
should have

var windowH=600;
var windowW=800;
defined

And I get
main
in front of the browser window that pops in both mozilla and IE6 on XP
0
iamcmagAuthor Commented:
I'm dead for the night and will take breather 'til tomorrow, I'm glad to see some new stuff I can wake up and try.

Cheers.
0
iamcmagAuthor Commented:
Back again.

Thanks for the correction mplungjan, it's sorted.
I tried your script yourbudweiser, but to me it makes no difference. The silly url is still there. This is starting to freak me out, it must possible to get rid of it. I seem to be running out of ideas though. Do you guys get the same results when running the same type of script elsewhere or could it be server sided? It doesn't appear if you run it locally.
0
Michel PlungjanIT ExpertCommented:
Please show a url and explain exactly what to look for where

Michel
0
iamcmagAuthor Commented:
http://www.andreasgustavsson.com/beta

I can't get rid of the url in front of my page title. That's really all that I want. Where it says "http://www.andreasgustavsson.com - :: andreasgustavsson.com" I want to rid the "http://www.andreasgustavsson.com -"

Thanks.
/Andreas
0
Michel PlungjanIT ExpertCommented:
Dunno where it says that.

I have :: andreasgustavsson.com :: in the titlebar of  IE6, mozilla and netscape 4.7 on windows xp

Michel
0
yourbudweiserCommented:
I don't see it either. Looks fine to me.

YBW
0
iamcmagAuthor Commented:
That's so wierd. I'm running IE6 myself, but then again I don't trust any of my computers one tiny bit. Maybe this is an excuse to get a new one *smiles*.

I will check it out and get back about the points.

Thanks alot guys.

/A
0
yourbudweiserCommented:
I have to give thanks to Michel. He originally helped me out when I had a similar problem.

Thanks for the points.

YBW
0
iamcmagAuthor Commented:
Since this thread ran for a long a time and I received good help from several people I have split the points in what I hope was a just manner. Thanks to everobody that got involved.

As a last question I would just like to ask if anyone has a clue as to what this problem could be since i run IE6 and XP myself. I've tried restoring security settings and pop-up blocker in IE which didn't change anything.

/A
0
MikeAllredCommented:
I had this exact same problem and just resolved it, although I'm not too thrilled with the answer - here it is
If you use window.open with no window features specified you get the title just the way you set it with no server name.  As soon as you add 'window features' you lose all the defaults. I went through the defaults one at a time until I found the culprit - location=1
Therefore to get the title to show the way you want it you also have to have the location bar showing

eg.
//this will show server name in title
var path="mainplayer.htm"
win=window.open(path,'','height=600,width=800');

//this shows only the title
var path="mainplayer.htm"
win=window.open(path,'','height=600,width=800,location=1');

//this also shows only the title
var path="mainplayer.htm"
win=window.open(path,'','');


0
Michel PlungjanIT ExpertCommented:
??? How come I had no problems then ?

Also location=1 can be written location
I have never experienced these problems anywhere.

Michel
0
iamcmagAuthor Commented:
Yeah I don't know, this is just a really strange problem. After I found out that it didn't seem to be showing everywhere I asked some different people to try the page. And I concluded that it was not just my machines that caused it. On some computers it shows and on some it doesn't. I really can't tell why since most even run the same IE version.

Thanks again everyone.

/A
0
aprasadhCommented:
I will tell you one thing. This is a bug in IE 6 for Win XP service pack 2.
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.