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 6 of 6
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    quick onlclick.href question

    hey.

    i have this div here

    Code:
                <DIV title='View "LTX15" details' style="CURSOR: hand" 
                onclick="location.href='ltx15.htm'">
    and i want the onclick="location.href='ltx15.htm'"> part to open a custom js window that uses this href="javascript:newWinProdInfo('ltx15.htm')">

    i tried
    Code:
    onclick.href='javascript:newWinProdInfo(\'ltx15.htm\')'>
    but it didnt work.

    what little tidbit am i missing?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #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
    For one you are using single quotes in your function AND the onclick. Its either double in the onclick and single in the function or the other way around not both, but you escaped the quotes but the javascript: isn't needed and there is no such thing as onclick.href
    Code:
    onclick="newWinProdInfo('ltu01.htm')"
    Now you have to ask yourself why are you using an onclick in a div when you can easily use a link that fills up the whole div.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    true... but that would involve asking myself a question... at which point i might hear voices answering me (they tell me i'm pretty...)



    it actually has its purpose; each div holds like 6 links to the same url (i'm redoing someones dirty code) so i just figured toss a div around it all and lose the 6 links.

    dude you're 2 posts away from 3000... you bess do a happydance!
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #4
    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
    Lol I just noticed my post count. Does the happy dance.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by canadianjameson
    it actually has its purpose; each div holds like 6 links to the same url (i'm redoing someones dirty code) so i just figured toss a div around it all and lose the 6 links.
    Doesn't sound much like a cleaner solution to me.
    Sounds like you're actually making the content at the end of those links less accessible.
    Last edited by Bill Posters; 09-16-2005 at 05:42 PM.

  • #6
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    baahahaha

    thats frikkin awesome!

    made my day
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

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