0
私は、jQueryで書かれたGoogleスタイルのインスタント検索スクリプトをPHPスクリプトから取得しています。スクリプトを作成して、特定のリンクをクリックしてファイルの宛先を変更することができます。特定のリンクをクリックすると、selected.tab変数が検索タイプの名前に変更されます。これどうやってするの?ここでjQueryタブで変数を変更する
は私のjQueryのスクリプトです:
$(document).ready(function(){
$("#query").keyup(function(){
var query=$(this).val();
var yt_url=''+selected.tab+'.php?q='+query;
window.location.hash=''+selected.tab+'/'+query+'/';
document.title=$(this).val()+" - My Search Script";
if(query==''){
window.location.hash='';
document.title='My Search Script';
}
$.ajax({
type:"GET",
url:yt_url,
dataType:"html",
success:function(results){
$('#results').html(results);
}
});
});
if(window.location.hash.indexOf('#'+selected.tab+'/')==0){
query = window.location.hash.replace('#'+selected.tab+'/', '').replace('/', '');
$('#query').val(decodeURIComponent(query)).keyup();
}
});
あなたはそれを昔ながらの方法で行うことができます 'change 1change 2を' –