Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Opening new windows

  • 18-04-2005 10:12pm
    #1
    Closed Accounts Posts: 927 ✭✭✭


    Hello I haven't much knowledge of web design but need some advice on a problem i have with a simple site. I have a page of thumbnails where links open in a new window but the orignal page reloads every time you click a link. How can I change this so that the original page does not reload?

    Link: http://www.p-art-icles.com/niall


Comments

  • Registered Users, Registered Users 2 Posts: 35,524 ✭✭✭✭Gordon


    You have each link going both to the index html and the destination html.

    a href="index.html" ONCLICK="window.open('computuererrors.htm',

    Not sure how you fix it but thats your problem


  • Registered Users, Registered Users 2 Posts: 597 ✭✭✭yeraulone


    anchor tags might be the answer here - you know how to use them?


  • Registered Users, Registered Users 2 Posts: 3,889 ✭✭✭cgarvey


    Monkey wrote:
    How can I change this so that the original page does not reload?

    change ..
    <a href="index.html" ONCLICK="window.open('computuererrors.htm', 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=560,height=600')">
    
    .. to ..
    <a href="#" ONCLICK="window.open('computuererrors.htm', 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=560,height=600')">
    
    .. or ..
    <a href="javascript:window.open('computuererrors.htm', 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=560,height=600')">
    

    .. or even better, use a javascript function to tidy up your A HREF tags...
    ...
    <head>
      ...
      <script type="text/javascript">
      <!--
        function openWin( url, w, h ) {
          window.open("computuererrors.htm", "NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + w + ",height=" + h );
        }
      -->
      </script>
    <head>
    ...
    

    .. and then change your links to ..
    <a href="javascript:openWin( 'computuererrors.htm', 560, 600 );">
    

    .cg


  • Registered Users, Registered Users 2 Posts: 236 ✭✭richardo


    Monkey wrote:
    Hello I haven't much knowledge of web design but need some advice on a problem i have with a simple site. I have a page of thumbnails where links open in a new window but the orignal page reloads every time you click a link. How can I change this so that the original page does not reload?

    Link: http://www.p-art-icles.com/niall

    Your page is reloading because each link has a <a href="index.html" and-thr-rest>

    Probably the simplest answer is to apply your Javascript code to the IMG tag and leave out the link altogether...

    Old code:
    <div align="center"><a href="index.html" ONCLICK="window.open('bookmarks.htm', 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=520,height=430')"><img src="bookmarksthumb.jpg" width="190" align="baseline" border="0" height="143"></a></div>

    New code:
    <div align="center"><img src="bookmarksthumb.jpg" width="190" align="baseline" border="0" height="143" ONCLICK="window.open('bookmarks.htm', 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=520,height=430')"></div>


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    cgarvey wrote:
    <a href="javascript:window.open('computuererrors.htm', 'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=560,height=600')">
    

    Why? Try visiting such a link with links or lynx. I'd also be interested to see how well search spiders pick up javascript: links.

    Use href="#" and a unique id. Then use a javascript onload to hijack the onlick event for that id.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    richardo wrote:
    Your page is reloading because each link has a <a href="index.html" and-thr-rest>

    Then add a "return false" to the end of the javascript call.


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    If you don't mind the toolbars etc on the new window, just use a normal link:
    <a href="page.html" target="_blank"><img src="img.gif"></a>
    


  • Registered Users, Registered Users 2 Posts: 3,889 ✭✭✭cgarvey


    hostyle wrote:
    Why? Try visiting such a link with links or lynx. I'd also be interested to see how well search spiders pick up javascript: links.

    I think it's reasonable to assume that the target audience is neither links or lynx. Images and Popups are not 2 features that either handle particularly well.

    I also think the SEO of his images (not his website content) is not of primary concern.

    Based on his post, and his website.

    .cg


Advertisement