/    Sign up×
Community /Pin to ProfileBookmark

Dose anybody have the code for opening up windows in a new box?

to post a comment
HTML

27 Comments(s)

Copy linkTweet thisAlerts:
@Baby_JaiJul 05.2003 — New box? you mean a pop up?
Copy linkTweet thisAlerts:
@Link96sauthorJul 05.2003 — no there's a code so that when you go to a link it opens it up in a new window instead of chagings the browers address.
Copy linkTweet thisAlerts:
@Baby_JaiJul 05.2003 — What designer are you using? you can make the target _new and it will open it up in new window
Copy linkTweet thisAlerts:
@Baby_JaiJul 05.2003 — <a href="www.yoursite.com" target="_new">The name of the link</a>
Copy linkTweet thisAlerts:
@David_HarrisonJul 05.2003 — Try this code to see if this is what you mean:

<script type="text/javascript"><!--

NewWindow = window.open("", "NewWindow", "width=200,height=150");

document.write('<html><head><title>Hi!!!</title></head><body>');

NewWindow.document.write('Page content goes here.');

NewWindow.document.write('</body></html>');

//--></script>
Copy linkTweet thisAlerts:
@Link96sauthorJul 05.2003 — I'm just using geocities advanced editor on internat exploer, but my fraekin data transfer just went down, I knew that was goin happen I guess I just gotta wait to up grade, what I'm doin is broadcasting mp3's 'one at a time' for promotional use only, I need my links to open up in new windows so that, the song stays on.
Copy linkTweet thisAlerts:
@Baby_JaiJul 05.2003 — hey lava, think thats a bit confusing for her, the other one will work just as well
Copy linkTweet thisAlerts:
@David_HarrisonJul 05.2003 — Perhaps you're right, it's just that about:blank was mentioned and by creating a new window on demand with js it saves creating a lot more windows by hand.

Anyway, not trying to step on you're toes or anything, here's my code:

First have all of the usual stuff:

<html><head><title>Hi!!!</title>

and then have this:

<script type="text/javascript"><!--

function playmusic(name,file_type){

playmusicwin = window.open("", name, "toolbar=no,status=no, width=200, height=200");

playmusicwin.document.write("<html><head><title>"+name+"</title></head><body>");

playmusicwin.document.write('<embed src="'+name+'.'+file_type+'" width="100%" height="100%" autoplay="false">');

playmusicwin.document.write("</body></html>");

playmusicwin.document.close();}

//--></script>

don't change any of the above code, you won't need to (unless you wanna experiment a little with js).

and then have:

</head><body>

All of you're content, and then:

</body></html>


now where ever you want a link to a music file have this:

<a href="#" onclick="playmusic('123','mp3');return false;">Play 123.mp3</a>

href="#" just means that the link does nothing (unless js is not-enabled in which case it will still appear to do nothing).

the onclick is what you need to worry about, inside the onclick this is what you have:

playmusic('123','mp3');return false;

playmusic(); just refers to a function created in the head that opens a pop-up window.

'123' is the name of the music file you want to open, so you might have 'Daniel Beddingfield - Gotta Get Through This'.

'mp3' is the file type, so you might have 'wav' or 'mid' etc.

return false; you don't need to worry about.


I've uploaded the entire example source so that you can see it all in one go, (it's shorter that it seems), rather than spaced out like it is here.

[upl-file uuid=b09e32f0-0583-453a-a0ae-f6eba148d2aa size=690B]example.txt[/upl-file]
Copy linkTweet thisAlerts:
@Link96sauthorJul 06.2003 — let me know how this works....

http://www.geocities.com/link96surviver
Copy linkTweet thisAlerts:
@Baby_JaiJul 06.2003 — Oh man! whats up!!!!!!!!!!!!!!!!!!!!! Im dancing all over the joint in my chair! uuuuuuuuuughhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh. That beat is hot, Louie Devito? How did you embedd it with no player? Loving it, i love it so much i didnt even wantt o click another link! Is that a mpeg or midi?
Copy linkTweet thisAlerts:
@Link96sauthorJul 06.2003 — hahaha it's an mp3.. DJ Santana... veiw the source
Copy linkTweet thisAlerts:
@David_HarrisonJul 06.2003 — I listened to that song, it's amazing. You upload more stuff like that and your site'll be the most popular on the web.? ? ?
Copy linkTweet thisAlerts:
@Baby_JaiJul 06.2003 — dont see it in the source. But i have over 1000 songs of hard house, and just one of them would take forever for someone to load, and what if they dont want to listen to it! Hmmm, got me thinking, did you change the bitrate so its a smaller file?
Copy linkTweet thisAlerts:
@David_HarrisonJul 06.2003 — He's using the bgsound element, not an embed.
Copy linkTweet thisAlerts:
@Baby_JaiJul 06.2003 — looks like he exceed his limit, whats the code to puyt it in the background?
Copy linkTweet thisAlerts:
@David_HarrisonJul 06.2003 — <bgsound src="music.mp3" loop="n">

although I think it's IE only. For n you can have any positive whole number to make it play that many times, or -1 or infinite to make it loop infinitely.
Copy linkTweet thisAlerts:
@Link96sauthorJul 07.2003 — yea it's just a simple tage ?BGSound="filename.mp3" loop="true"? and then just open up all your windows target= _"new" so that the music stays on... ? thank yall, next I need to add a BBS any advice for that? just so that other people can post links to there mp3's...
Copy linkTweet thisAlerts:
@khakiJul 07.2003 — hey lavalamp....

why'd you get shut down?

(i was looking forward to hearing the tune that Baby Jai was going-off about ? )

(and by the way Baby Jai... your brother is adorable. Too young for me... but he's a heartbreaker ? )

not yet ready to resume work-mode...

? k
Copy linkTweet thisAlerts:
@David_HarrisonJul 07.2003 — I didn't get shut down, I shut it down. Severe lack of interest. If you're really interested, (which if you are you're in a minority), you can go to it and type in /index2.html (couldn't be arsed deleting it).

Anyway it wasn't me that had the song on my website, (I had crap jokes), it was Link96s's site, (amazing song).
Copy linkTweet thisAlerts:
@khakiJul 07.2003 — Anyway it wasn't me that had the song on my website[/QUOTE] oh

(my bad)

anyway....

I went to Link's site...

didn't see (or hear) any music.

(I guess I'm left out of this party ? )

probably a Moz thing :rolleyes: ...

? k
Copy linkTweet thisAlerts:
@Link96sauthorJul 07.2003 — what kind of browser do you have khaki??
Copy linkTweet thisAlerts:
@DaveSWJul 07.2003 — [i]Originally posted by khaki [/i]

[B] Moz[/B][/QUOTE]


mozilla.

I'm in Opera and I get 'shall we play a game' and that's it. I'm currently downloading the space.mp3 which I presume is the bgsound you're refering to - it exceeds 4megs.

Not surprised you exceeded your bandwidth with that in there!!
Copy linkTweet thisAlerts:
@Link96sauthorJul 07.2003 — hmm, funny I've never heard of MOZ or Opera I just trying to attrack your average hey I got a pc and I wana surf the net and see whats out there.... so I am only supporting what is at my finger tips whiich is MS Internet Explorer and Window 98 on a Clone, but eventually I want to switch over to MAC whats the difference in the Mark up Language? Or is Opera and Moz just some business class thing.

RE: Space.Mp3, But once it downloads I'm just the que, and it should play as soon as the site opens up. I'm gonan a upload a new one a little later.

oops thats why it's XE...

-pozer-
Copy linkTweet thisAlerts:
@David_HarrisonJul 07.2003 — Opera and Mozilla are just two different browsers, I've downloaded Opera 7 and that's OK but I'm waiting for Mozilla 1.4 to come out before I download that.

By the way, what do you mean when you say:
oops thats why it's XE...[/QUOTE]
Copy linkTweet thisAlerts:
@Link96sauthorJul 07.2003 — dislexia... the new mp3's up ?
Copy linkTweet thisAlerts:
@DaveSWJul 07.2003 — [i]Originally posted by lavalamp [/i]

[B]I'm waiting for Mozilla 1.4 to come out before I download that.[/B][/QUOTE]


Wait no longer

http://www.mozilla.org/
Copy linkTweet thisAlerts:
@David_HarrisonJul 07.2003 — Thanks for that, the last time I checked it was only up to RC 3.
×

Success!

Help @Link96s 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 5.8,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...