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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need a little help

    Just doing a very basic coding change for my old man need a little help.

    Have changed the web page perfectly, but i need the web page to come up in a new window, below is copy of current script. Have trid all the _blank stuff, but i must be missing something. Have highlighted web page link in blue. Please note this is custom page supplied by software company for users to change for own use.

    <html>
    <head>
    <title>Body</title>

    <script language=javascript>


    // Load text from resource file
    function window_onload() {
    var d = new Date()

    document.all.lblEvents.innerText = objLang.LoadStringHTML(4031)
    document.all.lblAddUser.innerText = objLang.LoadStringHTML(4032)

    // Removed link buy and replace with customised page
    document.all.lblBuy.innerText = objLang.LoadStringHTML(5900)
    document.all.lnkBuy.href = "http://www.110uk.co.uk/index.html"(5901)
    document.all.lnkBuy.title = objLang.LoadStringHTML(5900)

    document.all.lblWatch.innerText = objLang.LoadStringHTML(5902)
    document.all.lnkWatch.href = objLang.LoadStringHTML(5903)
    document.all.lnkWatch.title = objLang.LoadStringHTML(5904)

    document.all.lblDocs.innerText = objLang.LoadStringHTML(4040)

    if ((objLang.LoadStringHTML(10) != "ENU") || (Math.abs(d.getTimezoneOffset() / 60) > 1))
    {
    document.all.idBuy.style.display = 'none';
    }

    if (objLang.LoadStringHTML(10) != "ENU")
    {
    document.all.idWatch.style.display = 'none';
    }
    }

    function RolloverOn(theid) {
    document.getElementById(theid).src = theid + ".png";
    document.getElementById("lbl" + theid).style.color = "#3D5A8D";
    }

    function RolloverOff(theid) {
    document.getElementById(theid).src = theid + "off.png";
    document.getElementById("lbl" + theid).style.color = "#7A838A";
    }

    </script>

    <link rel=stylesheet href="style.css" type="text/css">
    </head>

    <body bgcolor="White"
    style="background: url(Net2 Background.gif) no-repeat bottom right fixed"
    language=javascript onload="return window_onload()">

    <table id="iconTable">
    <tr>
    <td><a href="action:ViewEvents"><img id="Events" onmouseover="RolloverOn('Events')" onmouseout="RolloverOff('Events')" src="eventsOff.png" /></a><p id="lblEvents">lblEvents</p></td>
    <td><a href="action:AddUser"><img id="AddUser" onmouseover="RolloverOn('AddUser')" onmouseout="RolloverOff('AddUser')" src="addUserOff.png" /></a><p id="lblAddUser">lblAddUser</p></td>

    <td id="idBuy"><a href="lnkBuy" id="lnkBuy" target="_blank" title="lnkBuy"><img id="Buy" onmouseover="RolloverOn('Buy')" onmouseout="RolloverOff('Buy')" src="BuyOff.png" /></a><p id="lblBuy">lblBuy</p></td>

    <td id="idWatch"><a href="lnkWatch" id="lnkWatch" target="_blank" title="lnkWatch"><img id="Watch" onmouseover="RolloverOn('Watch')" onmouseout="RolloverOff('Watch')" src="watchOff.png" /></a><p id="lblWatch">lblWatch</p></td>
    <td><a href="action:ApplicationNotes"><img id="Docs" onmouseover="RolloverOn('Docs')" onmouseout="RolloverOff('Docs')" src="docsOff.png" /></a><p id="lblDocs">lblDocs</p></td>
    </tr>
    </table>

    </body>
    </html>

    <object
    id=objLang
    width=0 height=0
    classid="clsid:71F9D5FF-4E75-11D3-A32A-0080C8FC2F61"
    style="display:none">
    </object>




    Thanks very much for any pointers!

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    I don't use javascript very much so I'm going to ask you why on earth you are calling your links like that!? Can't you just put the URL in the page?

    And you should add a doctype to your page too as well as reading about Why Tables For Layout Is Stupid because at the moment the site is a coding mess!
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorry not my fault

    The entire page was written by a software company, the only part I have changed is highlighted in blue!...... not my fault, cant make head nor tail of it, (probably because it is such a mess) (plus i am pretty much a noob anyway). I managed to get the redirection sorted to the correct web page, but cannot make it appear in a new window, thats the only bit i need to change.

  • #4
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    When you say "_blank stuff" I presume this is what you've tried:

    Code:
    <a href="#" target="_blank">text</a>
    That will open it in a new window, but will be invalid under Strict doctypes.
    .
    .

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah that is exactly what i have tried!

    hence i am pleading for help on the forum

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,607
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Come on people, this guy wasn’t asking for an opinion on the cleanliness of his code, nor does he care whether the target attribute will validate according to strict rules. He was merely asking how to achieve what he has in mind.

    OK the fact that the code is really a mess doesn’t make it very easy for us to help but we shouldn’t confuse him more with momentarily irrelevant advice.

    When I copied the code you provided and clicked on the link it opened a new window (tab in my case) so I don’t see a problem there. I just don’t get any page as the href isn’t changed to the respective URL.

    And it’s giving me a JavaScript error: “objLang.LoadStringHTML is not a function”

  • #7
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Quote Originally Posted by VIPStephan View Post
    Come on people, this guy wasn’t asking for an opinion on the cleanliness of his code, nor does he care whether the target attribute will validate according to strict rules. He was merely asking how to achieve what he has in mind.
    I think it is pretty relevant to know exactly what he has tried. He wasn't being very specific, so my post was rather a question to him actually, to see if he remembered the target attribute.
    .
    .


  •  

    Posting Permissions

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