[Javascript] question on forms, windows, and locations
Yi Li
yili1998 at yahoo.com
Wed Apr 25 00:33:55 CDT 2001
Mark,
Please see following code, it works in IE & Netscape.
Is this what you want?
Yi
---------------CODE
START------------------------------
<html>
<head>
<script language="javascript">
<!--
function makeFLB()
{
var my_player_number =
document.FLB.player_number.value;
var FLB =
"http://games.espn.go.com/cgi/flb/request.dll?PLAYERCARD&nPlayerID="
+
my_player_number;
window.open(FLB, 'FLB',
"scrollbars=yes,toolbar=yes,menubar=yes,status=yes");
}
function makePRO()
{
var my_player_number =
document.FLB.player_number.value;
var PRO = "http://espn.go.com/mlb/profiles/profile/" +
my_player_number
+
".html";
window.open(PRO, 'PRO',
"scrollbars=yes,toolbar=yes,menubar=yes,status=yes");
}
//-->
</script>
</head>
<body>
<form name="FLB">
<input type="text" name="player_number">
<P>
<input name="player_number"
type="button"
value=" FLB Profile " onClick="makeFLB(); return
false;"></A>
<P></form>
<form name="PRO">
<input name="player_number"
type="button"
value="ESPN Profile" onClick="makePRO(); return
false;"></A>
</form>
</body>
</HTML>
------------------THE
END------------------------------
--- Mark Christie <MChristie at avsgroup.com> wrote:
> How about?:
>
> window.open(FLB, 'FLB');
>
> and
>
> window.open(PRO, 'PRO');
>
>
> Regards,
> -Mark C.
>
>
> -----Original Message-----
> From: Brian Johnston [mailto:brian at conbro.com]
> Sent: Tuesday, April 24, 2001 4:42 PM
> To: javascript at LaTech.edu
> Subject: [Javascript] question on forms, windows,
> and locations
>
>
> The short version:
> I play Fantasy Baseball.
> I use the Internet for a lot of Fantasy Baseball
> research.
> I use the same sites to look at different players.
> Each player has a unique ID number.
>
> I want to create a page to allow me to input the ID
> number, and then hit a
> button to generate a new a window with the link.
>
> I am using Javascript to take the ID number from the
> input box and put in
> the link. This I have done successfully.
>
> What I'd like to do now is have that link pop up in
> a new window. However,
> my limited knowledge in Javascript tells me that I
> have painted myself into
> a corner with the way I've written the code. I can
> get it to open the
> correct link, but not in a new window.
>
> Please take a look and tell me what I can do.
> I'd like to use buttons instead of text links.
> Unfortunately, I haven't
> figured out how to nail down the button part either.
> (also available at:
> http://www.memphismojo.com/brian/baseball.html)
>
> Thanks,
>
> Brian
>
> Now, the source:
>
> <html>
> <head>
> <script language="javascript">
> <!--
>
>
> function makeFLB(){
> var my_player_number =
> document.FLB.player_number.value;
> var FLB =
>
"http://games.espn.go.com/cgi/flb/request.dll?PLAYERCARD&nPlayerID="
> +
> my_player_number;
>
> window.location.href=(FLB);
>
> }
> function makePRO(){
> var my_player_number =
> document.FLB.player_number.value;
> var PRO = "http://espn.go.com/mlb/profiles/profile/"
> + my_player_number +
> ".html";
>
>
> window.location.href=(PRO);
> }
>
> //-->
> </script>
> </head>
>
> <body>
>
> <form name="FLB">
> <input type="text" name="player_number">
> <P>
> <a href="javascript:makeFLB()";>FLB Profile</a>
> <P></form>
>
>
> <form name="PRO">
> <a href="javascript:makePRO()";><input
> name="player_number" type="button"
> value="ESPN Profile"></A>
> </form>
>
>
> </body>
> </HTML>
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
More information about the Javascript
mailing list