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

    the innerHTML tag and child links

    I'm a newbie at js and started making my own script. I releaze the innerHTML script is deprecated, but I don't know why my links aren't working

    www.jaycmunns.com/album.php
    (when you put your mouse over the cd title list, the links at the bottom don't work but you can right click-> open in new window...)
    maybe its the way it refreshes?


    <code>
    <script type="text/javascript">
    var album_id = new Array("myblueheaven", "trustinme", "lettherest", "penthouseserenade", "imconfessinthat", "astimegoes", "buttonsandbows", "youmademe", "icantgive", "thesefoolishthings", "ithadto", "youtookadvantage", "always", "iminthe", "youdosomething", "illgetby", "mairsydoats", "someonetowatch", "cantwebe", "onthesunny", "idontknow");
    var album_name = new Array("My Blue Heaven", "Trust In Me", "Let the Rest of the World Go By", "Penthouse Serenade", "I`m Confessin` That I Love You", "As Time Goes By", "Buttons and Bows", "You Made Me Love You", "I Can`t Give You Anything But Love", "These Foolish Things", "It Had to Be You", "You Took Advantage of Me", "Always", "I`m in the Mood for Love", "You Do Something to Me", "I`ll Get By", "Mairsy Doats", "Someone to Watch Over Me", "Can`t we Friends?", "On the Sunny Side of the Street", "I Don`t Know Why");


    function expand(id, name)
    {

    for (i=0; i < 21; i++)
    {
    revert(album_id[i], album_name[i]);
    }

    var str = "<td id='" + id + "', onmouseout=\"expand('" + id +"' , '" + name + "')\"><p id='selected'><a href=\"" + id + "\" type=\"audio/x-ms-wax\">" + name + "</a>";
    str = str + "<br><a href='index.html' target='_blank'>Listen</a> | <a href='link.html'>Info</a> | <a href='link.html'>Lyrics</a></p></td>";
    document.all(id).innerHTML=(str);
    }

    function revert(id, name)
    {
    var str = "<td id='" + id + "', onmouseout=\"expand('" + id + "' , '" + name + "')\"><a href=\"" + id + "\" type=\"audio/x-ms-wax\">" + name + "</a></center></td>";
    document.all(id).innerHTML=(str);
    }

    </script></code>

    I hope that much code enough, don't want to swamp the message.
    Well I hope its something obvious
    thanks!

  • #2
    New to the CF scene
    Join Date
    May 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nm, ill find a work around

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    btw - innerHTML isn't deprecated because it was never a standard property - it's MS proprietary, but most of the other vendors have chosen to implement it as well. There's no problem with using it unless you're in XHTML mode.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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