Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Please help - cant open new window !!!

    On my site, I link from a listing to a new window.

    The site works fine in Moz FF but in IE it is ... half working.

    If you look at my front page you will see a
    three advert listing. Clicking on the links in IE
    works fine - a new window is opened. And when you close the window you go back to the main window again.

    BUT if you go to one of the main listings eg "Local Services"
    and then click on an advert there - a new window is NOT opened

    Can anyone see why this is ?
    If source code isn't enough I can post the relevent code chunks here
    ( please ask )

    My site: www.yodbod.com

    Thanks for your help cos this is driving me mad !!!
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Good chance IE is not liking the / in the name
    Code:
    var w = window.open (this.href, 'homes/accommodation/house-share-rooms/rentals/N/NN/ad-1.html', 'height=800,width=960,scrollbars');
    Why is your name (2nd parameter the url)? Just give it a simple one word name.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thank you

    I didn't know that was just a name param
    I thought it had to be th url.

    So it all works now !!!
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #4
    Senior Coder
    Join Date
    May 2006
    Posts
    1,683
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Presently when I click on another link it opens in the same secondary window, replacing the original advert.

    How can I have it open a new different window for each advert link.

    If you notice - I do have a "close this window" button

    I would like to give poeple the ability to open many adverts.

    What would I need to change in the code ?

    <a href='$Ad_detail' rel=\"external\" onclick=\"var w = window.open (this.href, 'advert', 'height=800,width=960,scrollbars'); w.focus(); return false\" >

    This js is loaded when the main window opens:

    function externalLinks() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") &&
    anchor.getAttribute("rel") == "external")
    anchor.target = "_blank";
    }
    }
    window.onload = externalLinks;


    I know this is a long-winded way of saying target = "_blank"
    but apparently target = "_blank" is now depreciated
    but you can use it js !!
    ( just trying to keep to w3w stds lol )

    Please check out the site at www.yodbod.com

    thanks
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Assign the windows different names to get separate windows. If you don't want to do it manually, use a JavaScript loop to assign different names (numbers) to each link or script it so that the current time becomes the name.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •