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 9 of 9
  1. #1
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How do you do this...

    On this yahoo article, scroll down to the word 'Napster' and click the arrow button - it performs an instant yahoo search on that keyword, does anyone know how this is done. i think it is very good, and would love to know.

    http://news.yahoo.com/s/ap/20060803/...nce_itunes_law

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #3
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    seeing as yahoo are using a lot of ajax features in their redesigns it suggests they are satisfied users are able to utilise such features. I suspect yahoo have done their research in to who can and who can't view these new features sets. thats good enough for me.

    What i want to know is how hard is to build that particular function, or if someone here can do it, pm me and i will move this to the paid services section.

  • #4
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's good for one site may not be good for another. Doing something or not doing something because one of the top 10 web sites does or doesn't do it is misguided at best.

    Check out GreyBox and ThickBox.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #5
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for those links. very interesting. however, i would like to understand yahoos function. any links or i will pay someone for an example.

  • #6
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After looking at it again, I've determined that my original assumption was wrong -- it doesn't use AJAX.

    There's a hidden form beside that link. In browsers that the script works in, when you click the link it creates a new <div> that contains among other things, an <iframe>, and positions the <div> near the link. It sets the target of the <form> to the ID of the <iframe> and submits the <form>, so the results load in the <iframe>. It's a lot more complicated than that, but that's basically what it does.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #7
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    well i am willing to pay for an example as i am intrigued how its done.

  • #8
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    With something like this:
    Code:
    <a class="search" href="http://www.google.com/search?q=napster">Napster</a>
    You could do:
    Code:
    (function() {
        function listener(event) {
            var target = event.target || event.srcElement;
            if (target.className == "search") {
                target.parentNode.insertBefore(document.createElement("iframe"), target.nextSibling);
                target.nextSibling.src = target.href;
                target.nextSibling.style.cssText = "width: 400px; height: 400px;";
            }
            event.returnValue = false;
            if (event.preventDefault) event.preventDefault();
        }
    
        if (document.addEventListener) document.addEventListener("click", listener, false);
        else if (document.attachEvent) document.attachEvent("onclick", listener);
    })();
    It's a little rough, and not tested, but it should get you started.

  • #9
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thanks Jason! I am gonna have a play with this.


  •  

    Posting Permissions

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