Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 04-26-2002, 09:00 PM jave script
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
This is the code...that im working with...My question is ...how do i make the links open in a new browser ? Like these two links...need them in a new browser ?

<option value="http://www.altonpost.net/bowl/bowlpage.htm"> Bowling Game

<option value="http://www.altonpost.net/blackjack/index.html">
BlackJack




Thanks

Jeff


<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Original: Alex Tu <boudha1@hotmail.com> -->
<!-- Web Site: http://www.geocities.com/alex_2106 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
</HEAD>

<!-- STEP TWO: Paste this code into the BODY of your HTML document -->

<BODY>

<center>
<form name="form">
<select name="site" size=1>
<option value="">Go to....
<option value="http://www.altonpost.net/bowl/bowlpage.htm"> Bowling Game
<option value="http://www.altonpost.net/blackjack/index.html">BlackJack
<option value="http://www.jokesgalore.com/members/show.php?flag=2&cat=all&uid=18661">Jokes
<option value="http://www.altonpost.net/stock.htm" target="_blank">Stock Pick</a>
<option value="http://www.lycos.com">Lycos
<option value="http://yahoo.com">Yahoo
</select>
<input type=button value="Go!" onClick="javascript:formHandler(this)">
</form>
</center>

<p><center>
<font face="arial, helvetica" size="-2">Enjoy the Links<br>
by <a href="http://www.altonpost.net">The Alton Post</a></font>
</center><p>
altonpost is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-26-2002, 09:53 PM
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
Just add:
target ="_blank">
at the end of each of your links...

Example Below

<a href="http://www.webmaster-talk.com" target="_blank">Visit the Webmaster-Talk.com Forums!

You would have:

<option value="http://www.altonpost.net/bowl/bowlpage.htm" target="_blank"> Bowling Game
<option value="http://www.altonpost.net/blackjack/index.html" target="_blank">BlackJack


Let me know if you have any questions...
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-26-2002, 11:06 PM java reply
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
yep....I did that...didnt work...I had tryed that before....I think Java might be different...weird....hmm..any other suggestions ?

thanks

Jeff
altonpost is offline
Reply With Quote
View Public Profile
 
Old 04-26-2002, 11:16 PM Hey
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
Can you post the exact URL of the page/site you got the javascript code from and I'll see if I can get it to work...

Thanks
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-26-2002, 11:26 PM Site and code
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
Thanks




http://javascript.internet.com/navigation/menu.html




<!-- TWO STEPS TO INSTALL PULLDOWN MENU:

1. Paste the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Original: Alex Tu <boudha1@hotmail.com> -->
<!-- Web Site: http://www.geocities.com/alex_2106 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
</HEAD>

<!-- STEP TWO: Paste this code into the BODY of your HTML document -->

<BODY>

<center>
<form name="form">
<select name="site" size=1>
<option value="">Go to....
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.metacrawler.com">Metacrawler
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://javascript.internet.com">JavaScript Source
</select>
<input type=button value="Go!" onClick="javascript:formHandler(this)">
</form>
</center>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.20 KB -->
altonpost is offline
Reply With Quote
View Public Profile
 
Old 04-26-2002, 11:33 PM ...
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
The first error (why it was not working for me) is here:

onClick="java script:formHandler(this)">

make it:

onClick="javascript:formHandler(this)">

Without the space after java....

Next I gotta figure out getting it to open in a new window...
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 12:04 AM thanks
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
it works just fine...even with the space...just cant get the new window up...ok...keepworking....eheheheh

Thanks

Jeff
altonpost is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 12:21 AM hmm
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
Didnt work for me with the space, but maybe it was something else.

I've been trying a number of different things to try and get it to open up in a blank window but the darn thing just won't work for me

I'll keep trying...
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 12:33 AM Yeah
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
Don't give up...This is ridiculous...Ive tryed alot of things myself...

Thanks....If your frustrated it can wait.....

Thanks

Jeff
altonpost is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 12:44 AM
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
Quote:
Don't give up...This is ridiculous...Ive tryed alot of things myself...
I'll get it. I just don't know if it will be tonight though
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 01:02 AM !
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
I got it to work! Sort of...

In the Header change to:

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = window.open(URL);
}
// End -->
</SCRIPT>

It opens the URLS in new windows, but then causes a 404 error on the goto page...
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 01:11 AM lol
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
Thats a good one......I think it has something to do with the http:...the code isnt reconizing it...I beleive java has there own codes for windows opening in a new browser....Not sure...keep trying....and you don't need no stinking sleep...heehhehe

Thanks

Jeff
altonpost is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 01:19 AM Well
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
I know how to use JavaScript to open up links i new windows, just not when it is in a drop down like that.

Sorry, but I'll have to try some more tommorrow.
I'm sure some of our other members know how to do this also (when they find the post)...

Your site is coming along very nicely!
Did Chopper get ahold of you yet?

See YA
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 04-27-2002, 01:23 AM Hiya
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
Havent heard from chopper...and thanks for helping...I know you know what your doing...but im a wanna be...and I have to act like I know something...ehheehhe...thanks for the compliment...

Thanks alot

Jeff p.s Dont let the bed scripts bite
altonpost is offline
Reply With Quote
View Public Profile
 
Old 04-30-2002, 01:42 PM alton
TimSchroeder's Avatar
Admin/Owner

Posts: 6,141
Location: Orlando, FL
Trades: 0
altonpost,

Did you ever figure this out?
__________________
Webmaster-Talk Admin -
Please login or register to view this content. Registration is FREE
| My
Please login or register to view this content. Registration is FREE
.


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

TimSchroeder is offline
Reply With Quote
View Public Profile
 
Old 05-15-2002, 12:32 AM ooops
Extreme Talker

Posts: 168
Location: Alton , Illinois
Trades: 0
sorry....been out of town for awhile...I gave up on that menu and went with a different one !

Thanks anyways
altonpost is offline
Reply With Quote
View Public Profile
 
Old 05-23-2002, 03:14 PM I have a solution!
kline11's Avatar
SearchBliss Web Tools

Latest Blog Post:
Oracle Embraces the Cloud
Posts: 1,724
Name: John
Location: USA
Trades: 0
I have a Drop-Menu generator on my site SearchBliss that allows you to open the URLs in a new window using JavaScript. I think you will find the solution using my generator.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
Reply With Quote
View Public Profile
 
Old 06-16-2002, 02:47 PM
Junior Talker

Posts: 4
Location: texas
Trades: 0
Old thread, but in case you are still curious...

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.open(URL);
return false;
}
// End -->
</SCRIPT>

put this in your option tag.
onclick="formHandler(this);"

And don't forget to close the option tag. It isn't required, but it is required according to the spec and it is a good practice to follow the spec just in case browsers decide to enforce it.
MrgnWlkr is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to jave script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.62984 seconds with 12 queries