Я копирую этот код на своей странице с тем же именем идентификатора и всем, и он никогда не работает
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="pasha_js/yui-min.js"></script>
<script type="text/javascript">
YAHOO.example.Data.arrayStates = [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
...
];
YAHOO.example.BasicRemote = function() {
// Use an XHRDataSource
var oDS = new YAHOO.util.XHRDataSource("assets/php/ysearch_flat.php");
// Set the responseType
oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
// Define the schema of the delimited results
oDS.responseSchema = {
recordDelim: "\n",
fieldDelim: "\t"
};
// Enable caching
oDS.maxCacheEntries = 5;
// Instantiate the AutoComplete
var oAC = new YAHOO.widget.AutoComplete("myInput", "myContainer", oDS);
return {
oDS: oDS,
oAC: oAC
};
}();
</script>
<style type="text/css">
#myAutoComplete
{
width:15em; /* set width here or else widget will expand to fit its container */
padding-bottom:2em;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<label for="myInput">Search our database:</label>
<div id="myAutoComplete">
<input id="myInput" type="text">
<div id="myContainer"></div>
</div>
</body>
</html>
есть идеи, почему?