Jump to content

Looking for Basic help with script


LASNera

Recommended Posts

I'm trying to get a script to read information from a link in a document and use it

to open a pop-up window with the url from the link.

There are 50 different links on this page that all need to open individual popups

on user request.

 

Can someone tell me what I'm doing wrong?  I tried to do it using form objects,

because I really couldn't figure out how to do it from a text link, although I

assume that is also possible and is what I really wanted to do.

Here's what I tried, I know it's off, but I don't know why - I'm still learning javascript.

I'd really appreciate any help, thanks:

 

in head:

< script >

function squadId (){

    var sq = document.squads.button.value;

    var i = sq + .html

    settings='width=350,height=400,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,

          resizable=yes,fullscreen=no'

    doIt = window.Open ('i','Squadlistings',settings);

    doIt.focus();

}

< /script >

 

in body:

 

<form action="" method="post" name="squads" id="squads">

 

<TD HEIGHT="30" WIDTH="110" align="center" class="sqtext">

<a href=""><input type="button" name="BD" id="BD" value="Blue Devils" onClick="javascript:squadId()";></a></TD>

 

 

If anyone can correct this, or better, tell me how to do this with just text links, I'd be most grateful.

I believed there must be some way to have it get the info from the link instead of putting window.open functions

in every link on the page, right?

 

Thanks!!!

 

Link to comment
Share on other sites

as far as using forms... no... you either need to get info the way you are... or... use form submissions...

 

however... if you were to just <a href="yourpage.html?squad=blue devils">LINK</a> you could then pick that up on the other side without a form :-)

 

 

<script>
function squadId (){
var i = document.squads.button.value+'.html'
settings='width=350,height=400,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,fullscreen=no'
doIt = window.Open(i,'Squadlistings',settings);
doIt.focus();
}
< /script >

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.