Click to See Complete Forum and Search --> : get javascript to open page in blank window


blade69
10-24-2004, 08:13 PM
Hi again,
Ok, I really need help with this, and although the tutorial and forums are a great help, they haven't answered my question yet.
I've got 3 flash banners on my website (http://www.mycasinonline.biz). 2 on my main.html and 1 in links.html. My index.html is cut into frames and this code i'm showing you is in the main frame. I need the banners to open in a new window, but they open in the main frame instead. I've also posted below some fixes ive already tried and the results of each. All 3 script is setup in this format right now:

<!-- Windows Casino Flash Banner Code Begin -->
<script language='Javascript'>
function geturl() { window.location='http://webmaster.windowscasino.com/affiliates/
aiddownload.asp?affid=1234' }
</script>
<OBJECT> My Flash Object, very long code</OBJECT>
<!-- Windows Casino Flash Banner Code End -->

I tried using
Function window.open ()
in the above text and got the same result
also tried Function window.open.top () thinking it would open in parent overtop the frames, but it still opened in the main frame


I've tried using this format

<head>
<script language="JavaScript">
<!-- function opener() {windy1=window.open('http://
webmaster.windowscasino.com/affiliates/aiddownload.asp?affid=1234',
[w1,width=500,height=300,toolbar=yes,status=yes,resizable=yes,
menubar=yes,scrollbars=yes) } //-->
</script>
</head>
<body
<a href="javascript:opener()"> <object> blah blah blah </object></a>

this code crashed the browser when opened (which blew me away). no errors, IE just opened... then closed (crashed). Wierd

I even tried a standard html code
<a href="http://webmaster.windowscasino.com/affiliates/
aiddownload.asp?affid=1234" target="_blank">
<object>blah blah blah</object></a>
this still opened in the main frame, which didn't make sense to me.


None of it seams to work. Props to the author of the javascript tutorial, though. I got a much better understanding this stuff now. (even thought I'm still totally lost) :D

Please Help?

javaNoobie
10-24-2004, 10:25 PM
html way:
<a href="http://www.google.com" target="_blank">Google</a>
JS way (note the quotes):

<a href="#" onclick="window.open('http://www.google.com','childWin','');return false;">Google</a>

blade69
10-24-2004, 11:01 PM
Thank you, javanoobie,

let me get this straight before i try it

<a href="#" onclick="window.open
('http://webmaster.windowscasino.com/affiliates/aiddownload.asp?
affid=1234','childWin','');return false;"><object><!--this being my
flash code--></object></a>


is this the right syntax?

and do i still need this in my heading?<!--
function opener() {windy1=window.open
('http://webmaster.windowscasino.com/affiliates/aiddownload.asp?
affid=1234',
[w1,width=500,height=300,toolbar=yes,status=yes,resizable=yes,menubar=
yes,scrollbars=yes)
}
//-->

javaNoobie
10-24-2004, 11:09 PM
Syntax looks right, and you do not need that in your heading.

blade69
10-24-2004, 11:09 PM
And my html editor generates code alittle funny, putting []'s and other symbles in that are wierd to me. So, if my code is true enough, please let me know:D

blade69
10-24-2004, 11:37 PM
Thanks again but this link is still opening in the frame
heres the modified code i tried
<a href="#" onclick="window.open
('http://webmaster.windowscasino.com/affiliates/aiddownload.asp?
affid=1234','childWin','');return false;">

<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=5,0,0,0' WIDTH=728 HEIGHT=90>

<PARAM NAME=movieVALUE='728x90_1.swf'>

<PARAM NAME=quality VALUE=high>

<PARAM NAME=bgcolor VALUE=#000000>

<EMBED src='728x90_1.swf'quality=highbgcolor=#000000 WIDTH=728
HEIGHT=90 TYPE='application/x-shockwave-flash' PLUGINSPAGE=
'http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash'>

</EMBED>

</OBJECT>

</a>


and I posted the hole script this time
I feel like I'm pounding my head on a brick wall. I wonder how any of you web developers keep your sanity! :P

javaNoobie
10-24-2004, 11:53 PM
Why don't you try coding in your flash file?

blade69
10-25-2004, 12:24 AM
Huh??? What do you mean? :confused:

BonRouge
10-25-2004, 01:27 AM
This works for me...

onclick=javascript:window.open("http://cheers-sendai.com","child","")

maybe it could be better to do this in your flash - but I don't know a thing about that .:o

javaNoobie
10-25-2004, 01:33 AM
Took a look at your link. You can try changing your geturl() function to window.open() instead of window.location

blade69
10-26-2004, 11:18 AM
Ok, lets try this, on my index.html, in the lower frame (main.html), I will edit the first flash banner with BonRouge's suggestion. For the second flash banner at the bottom of the page I will edit to match javanoobie's suggestion. then, I will upload both to my ftp for all to see. Give me bout 20 min to compleate this and then Enter here (http://www.mycasinonline.biz) to see the results. View my source to verify the changes were made. Try the banner links to see if they work. I ofcource will do the same. I just think it might make is easier if we all can see and interact with the problem I'm facing.

And Thank You Again for all your help.

blade69
10-26-2004, 11:53 AM
<!-- Windows Casino Flash Banner Code Begin -->

<a href="#" onclick=javascript:window.open
("http://webmaster.windowscasino.com/affiliates/aiddownload.asp?
affid=1234","child","")>

<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=5,0,0,0' WIDTH=728 HEIGHT=90><PARAM NAME=movie
VALUE='728x90_1.swf'>

<PARAM NAME=quality VALUE=high>

<PARAM NAME=bgcolor VALUE=#000000>

<EMBED src='728x90_1.swf' quality=high bgcolor=#000000 WIDTH=728
HEIGHT=90 TYPE='application/x-shockwave-flash'
PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash'>

</EMBED>

</OBJECT>

</a>

<!-- Windows Casino Flash Banner Code End -->

---------------------------------------------------------------------

<!-- Windows Casino Flash Banner Code Begin -->

<script language='Javascript'>

function window.open('http://webmaster.windowscasino.com/affiliates/aiddownload.asp?
affid=1234')

</script>


<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=5,0,0,0' WIDTH=728 HEIGHT=90><PARAM NAME=movie
VALUE='728x90_3.swf'>

<PARAM NAME=quality VALUE=high>

<PARAM NAME=bgcolor VALUE=#000000>

<EMBED src='728x90_3.swf' quality=high bgcolor=#000000 WIDTH=728
HEIGHT=90 TYPE='application/x-shockwave-flash'
PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>

</EMBED>

</OBJECT>

<!-- Windows Casino Flash Banner Code End -->


Here are the changes right off the source code off my website. the first one don't work at all, as you can see.

the second doesn't work at all either.

I'm being such a pain in the butt, I know. You can tell me to stick it whenever you wan't. My feelings won't be hurt. But, if you can help me solve this, I will forever be in your dept.

javaNoobie
10-27-2004, 10:06 AM
What I meant was this:

function geturl(){
window.open('http://webmaster.windowscasino.com/affiliates/aiddownload.asp?affid=1234','childWin','')
}

blade69
10-27-2004, 10:11 PM
Thank you,

I've deceided to start over and just revamp my site. The frames just cause more problems than they fix. I've ordered Topstyle 3.10, and I'm going to convert to xhtml and see if I can't clean it up. Look for my new site in the review forum. Thank you again for all your help.