Opening window coding (HTML)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

asbo

Thread Starter
Joined
Sep 21, 2001
Messages
507
I am making a website in which you click a
Code:
<_a href="xxxx.html" target="_blank">   (first underscore is on purpose)
link and was wondering if opening it at a certain size and aligment was possible and how to do it. This is mainly directed at Classylinks because she has so much experience. Thanks!!!
 
Joined
Jul 29, 2001
Messages
21,334
She is awesome, no doubt about it!! Answering your question, you need some java script to do what you are trying to accomplish.

"window.open ('name.html', 'newwindow', config='height=150,width=510, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')"

Something similar
 

asbo

Thread Starter
Joined
Sep 21, 2001
Messages
507
That works fine, but the thing is I want it to open and stay on the right side of the screen. Is that possible? Is there any applet out there that I could use to achive this? Thanks for all your help.
 
Joined
Nov 2, 2000
Messages
637
are you trying to use frames? or do you just want the window to open at a specific location in the user's screen. You can specify the location it opens at by using

leftPos = 0
if (screen) {
leftPos = screen.width-395
}

newWin = window.open('page.html','newWin',
'width=375,height=385,left='+leftPos+',top=0')

here's the link to my javascript class I'm currently taking...look at the position01.html example code
http://packard.flint.umich.edu/~swturner/Classes/csc286/ex07.html
 

asbo

Thread Starter
Joined
Sep 21, 2001
Messages
507
Go to http://www.angelfire.com/tx4/graphx/pooglesolution.html and look at the source. I've made the actual link a comment, but it is easy enought to read. I am try to make what is in the IFRAME open in a thin, screen-tall window on the RIGHT of the screen. Thanks for your time.
 
Joined
Nov 2, 2000
Messages
637
try this code for you script

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

leftPos = 0
if (screen) {
leftPos = screen.width-105
}

function newWin() = {
tobepened=window.open('http://www.angelfire.com/tx4/graphx/pooglesol.html','newWin',
'width=375,height=385,left='+leftPos+',top=0')
}

// stop hiding -->
</script>


Link looks like

< A href="javascript:newWin()">Link to open goes here</a>

I had to play with the formatting to get the code to show, so yo may need to do a little more than copy and paste, but this should open you window in a new window that's 105 px from the right side. Check out the examples from the URL I gave you earlier.
 

asbo

Thread Starter
Joined
Sep 21, 2001
Messages
507
Well, it looks good to me, but (using IE), I get an Object Expected error. :( Have any idea why? You can check my script again, if you like. (<a href="http://www.angelfire.com/tx4/graphx/pooglesolution.html" target="_blank">http://www.angelfire.com/tx4/graphx/pooglesolution.html</a>). By the way, do you know if there is anyway to gaurd the link with a password...
I.E.:

1. Link is clicked
2. Box pops up asking for password
3a. If p/w is correct, then loading continues.
3b. If p/w is incorrect, redirects to err page.

Sorry, but I'm a COMPLETE dunce when it comes to HTML-Java(Script) interaction. I can barely code HTML! :eek: ;)

Thanks!
 

Spu

Joined
Nov 25, 2001
Messages
71
If you can use ASP on angelfire then you could make a protected page, you could alo use Javascript.

The best way (most secure) to password protect is by using the .htaccess/.htpasswd (CGI) set of files as this is server side scripting, although many free (and even paid) hosters don't except this (*******s).

If you want the ASP password protection either follow this link http://htmlgoodies.earthweb.com/beyond/asp2.html or by using Macromedia Ultradev. If your hoster supports it then help with the .htaccess files is here http://vwww.netcom.net.uk/userguide/passprotect.html

Another way to do it is this way (follow link) http://www.dynamicdrive.com/dynamicindex9/password.htm . Haven't read through the process of this one yet though.

With the password protect, all apart from the .htaccess aren't that secure. Once the person has entered the password protect page, they can bookmark the URL (pass the url on to other people) and bypass the password script. So don't put any really valuable info on it.

Hope this helps,

Spu
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top