Web Analytics Made Easy -
StatCounter Opening html file into new window - CodingForum

Announcement

Collapse
No announcement yet.

Opening html file into new window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Opening html file into new window

    Hi

    I am still having problems with this script. I know it's a simple problem, but I just
    can't find the solution. When the user clicks on the arrow, the frameset should close,
    and entry.htm should be loaded. Have a look at the website so far,
    http://homepages.ihug.co.nz/~usateden/panacea/frameset/


    <script language="javascript">

    function back() {
    window.open('../entry.htm');
    window.top.close();
    }
    </script>
    </head>

    <body background="bg.GIF" bgproperties="fixed">
    <div align="right">

    <table border="0" cellpadding="0" width="90%">
    <tr>
    <td width="100%"><p align="left"><a href="java script:back();"><img
    src="backarrow.gif"


    Can anyone help with this please?

    bye
    Allyson

  • #2
    when i clicked the arrow, it says 'Object expected'

    try to rename your function back() to something else. back() is a reserved method
    Glenn
    vBulletin Mods That Rock!

    Comment


    • #3
      Well, you've got a problem there. Unless you've opened the window WITH javascript, you can't close it without getting some type of warning (usually. some browsers dont follow this).

      Your current function:

      function back() {
      window.open('../entry.htm');
      window.top.close();
      }

      Try something like this instead:

      function back() {
      top.location.href="../entry.htm";
      }


      try to rename your function back() to something else. back() is a reserved method
      yeah, that too

      Comment

      Working...
      X