Почему если вызвать
$( function() {
$( '.11' ).dropdown( {
gutter : 5,
slidingIn : 100
} );
});
тогда выходит TypeError: KWeb is null и все не работает
<div id="content">
<div id="searchContainer">
<div id="searchForm">
<div id="searchLogoContainer">
<img id="searchEngineLogo"/>
</div>
<img id="sIMG" src="" />
<input type="search" name="q" id="searchText" maxlength="256" autofocus="autofocus" placeholder="2" results="0" onkeypress='if(event.keyCode==13){KSearch(true);} '/>
<input id="searchSubmit" type="button" value="3" onclick="KSearch(true);"/>
</div>
<br/>
<select id="KSType"></select>
</div>
</div>
<section class="main clearfix">
<select class="11" name="KSWeb" id="KSWeb" onchange="KSearch(false);">
<option class="text" value="Yandex">Яндекс</option>
<option class="text" value="Google">Google</option>
<option class="text" value="Wikipedia">Wikipedia</option>
<option class="text" value="youtube">Youtube</option>
<option class="text" value="Bing">Bing</option>
<option class="text" value="duckduckgo">DuckDuckGo</option>
</select>
</section>
function KSearch(sGo)
{
var KWeb,KWebindex,Ktype,Ktypeindex,gsearchForm,tStyle,sURL;
KWeb=document.getElementById('KSWeb');
KWebindex=KWeb.selectedIndex;
Ktype=document.getElementById('KSType');
Ktypeindex=Ktype.selectedIndex;
gsearchForm=document.getElementById('searchForm');
gsearchFac=gsearchForm.action;
gsearchtext=document.getElementById('searchText');
tStyle=Ktype.style;
sImage=document.getElementById('sIMG');
switch (KWeb.value)
{
case "Google":
if(Ktypeindex){
sURL="http://www.google.com/images?q=";
}else{
sURL="http://www.google.com/search?num=100&q=";
}
tStyle.display='none';
sImage.src="google2.png"
break;
case "Yandex":
if(Ktypeindex){
sURL="https://yandex.ru/images/search?clid=2295666&text=";
}else{
sURL="https://yandex.ru/search/?clid=2295666&text=";
}
tStyle.display='none';
sImage.src="Yandex.png"
break;
case "Bing":
if(Ktypeindex){
sURL="http://www.bing.com/images/search?q=";
}else{
sURL="http://www.bing.com/search?q=";
}
tStyle.display='none';
sImage.src="bing.png"
break;
case "Wikipedia":
sURL="http://ru.wikipedia.org/w/index.php?title=Special%3ASearch&fulltext=Search&search=";
tStyle.display='none';
sImage.src="Wikipedia.png"
break;
case "youtube":
sURL="http://www.youtube.com/results?search_query=";
tStyle.display='none';
sImage.src="youtube.png"
break;
case "duckduckgo":
sURL="http://duckduckgo.com/?q=";
tStyle.display='none';
sImage.src="DC.png"
break;
default:
sURL="https://www.google.com/search?btnI=1&q=";
tStyle.display='none';
sImage.src="google.png"
}
if (sGo)
{
sURL=sURL+gsearchtext.value;
//alert(sURL)
window.location=sURL;
}
}
$( function() {
$( '.11' ).dropdown( {
gutter : 5,
stack : false,
slidingIn : 100
} );
});