• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Vorgeschlagene Suchanfragen

Vinek

Neues Mitglied
Hallo Com,
ich möchte in meinen Search Engine gerne die Vorgeschlagene Suchanfragen oder wie das heißt, wie bei Google einbauen und wollte euch nun fragen wie ich das hinbekommen.
"Recent Searches"habe ich bereits also speichre ich auch die Suchanfragen.

Hier ist das was ich meine:
recent.jpgsearch.jpg

Ich hoffe ihr könnt mir helfen.

MfG
Vinek
 
Zuletzt bearbeitet:
Werbung:
Dann muss ich bei

$( "#tags" ).autocomplete({

anstatt Tags wahrschienlich denn Namen meines Suchfeldes eintragen oder?
 
Werbung:
Okay Danke.
Aber wenn ich versuche es einzurichten passiert nichts auf der Seite, nichtmal ein Fehler, die Seite läuft einfach so wie voher weiter.
Hier mal mein Code ich hoffe Ihr könnt mir helfen:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="Kevin Schröder-Bathe">
<meta name="publisher" content="Kevin Schröder-Bathe">
<meta name="copyright" content="Kevin Schröder-Bathe">
<meta name="description" content="This is the ultimate tool for search lyrics in the world wide web.
Lyricsed have the most lyrics in the web.
">
<meta name="keywords" content="lyrics, search, engine, music, artist, song, text, lyricsed, lyric, song, lyrics, music, lyrics">
<meta name="audience" content="Alle"><meta http-equiv="content-language" content="en">
<meta name="robots" content="index, follow">

<title><?php echo $title; ?></title>
<script src="<?php echo DIR_BASE; ?>jquery_1.4.2.js" language="javascript"></script>

<link href="<?php echo DIR_BASE; ?>style.css" rel="stylesheet" type="text/css" />
<script>
function get_results(type){
    var query = $("#query").val();
    $("#results").html('');
    $("#searching").show();
    $.post("<?php echo DIR_BASE; ?>index.php", { query:query, type:type },
       function(data){
        $("#searching").fadeOut(300,function(){
            $("#results").hide().html(data).fadeIn(400)
        });
       });
} 
function get_lyrics(id,title){
$("#results").html('');
    $("#searching").show();
    $.post("<?php echo DIR_BASE; ?>index.php", { id:id,title:title },
       function(data){
        $("#searching").fadeOut(300,function(){
            $("#results").hide().html(data).fadeIn(400)
        });
       });
}
function submit_search() {
    var query = $("#query").val();
    query = encodeURIComponent(query);
    var newurl = '<?php echo $site; ?>search/'+query;
    window.location = newurl;
}
</script>
<script>
    $(function() {
        var availableTags = [
            "ActionScript",
            "AppleScript",
            "Asp",
            "BASIC",
            "C",
            "C++",
            "Clojure",
            "COBOL",
            "ColdFusion",
            "Erlang",
            "Fortran",
            "Groovy",
            "Haskell",
            "Java",
            "JavaScript",
            "Lisp",
            "Perl",
            "PHP",
            "Python",
            "Ruby",
            "Scala",
            "Scheme"
        ];
        $( "#query" ).autocomplete({
            source: availableTags
        });
    });
    </script>
</head><body>

<div id="outer">
    <div id="wrapper">
    
        <div align="center" id="logo">
        <a class="logo" href="<?php echo $site?>"><img src="<?php echo DIR_BASE; ?>images/logo.png" border="0" title="Lyrics Bubbles" /></a>
        </div>
        
        <div id="search_form">
            <div align="center">
            <?php
            if($simple_mode === false)
            {
            ?>
                <input type="text" autocomplete="off" id="query" name="query" class="txt" value="Type a Song or Artist..."
                 onblur="if(this.value=='') this.value='Type a Song or Artist...';" onfocus="if(this.value=='Type a Song or Artist...') this.value='';" /><br />
                <input type="submit" name="submit" onClick="submit_search();" value="Search Artists & Songs" class="btn"/>
            <?php
            }
            else
            {
            ?>
                <input type="text" autocomplete="off" id="query" name="query" class="txt" value="Type a Song or Artist..."
                 onblur="if(this.value=='') this.value='Type a Song or Artist...';" onfocus="if(this.value=='Type a Song or Artist...') this.value='';" /><br />
                <input type="submit" name="submit" onclick="get_results('artist');" value="Search Artists" class="btn"/>
                <input type="submit" onclick="get_results('songs');" name="submit" value="Search Songs" class="btn"/></div>
            <?php
            }
            ?>
        </div>
        
        <div id="ads">
            <script type="text/javascript" src="http://view.binlayer.com/ad-57114.js"></script>
        </div>
        
<div id="searching" align="center">
<img src="<?php echo DIR_BASE; ?>images/loader.gif" border="0" />
<p>Loading..</p></div>
<?php
if(SIMPLE_MODE === true)
{
    echo '<div id="results"></div>';
}
?>

Ich habe auch schon versucht die div id einzutrage bringt aber auch nichts.

MfG
Vinek
 
In der JavaScript-Fehlerkonsole geschaut? Debugging betrieben, also etwa Kontrollausgaben an bestimmte Punkte des Codes gesetzt?
 
Werbung:
Zurück
Oben