1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Opening window coding (HTML)

Discussion in 'Software Development' started by asbo, Nov 18, 2001.

Thread Status:
Not open for further replies.
Advertisement
  1. asbo

    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!!!
     
  2. Rockn

    Rockn

    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
     
  3. asbo

    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.
     
  4. deuce868

    deuce868

    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
     
  5. asbo

    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.
     
  6. deuce868

    deuce868

    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.
     
  7. asbo

    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!
     
  8. Spu

    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
     
  9. Sponsor

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 733,556 other people just like you!

Loading...
Similar Threads - Opening window coding
  1. muckmail
    Replies:
    16
    Views:
    1,273
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/58969

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice