Val*_*Val 1 jquery user-interface google-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>
<title>My Google AJAX Search API Application</title>
<script src="http://www.google.com/jsapi?key=blahblahblah" type="text/javascript"></script>
<script language="Javascript" type="text/javascript">
google.load("jquery", "1");
google.load("jqueryui", "1");
</script>
</head>
<body>
<div class="ui-state-highlight">
hello world
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但是<div></div>应该显示hello world的错误框.但它没有显示红色背景因此ui无法正常工作......
我在这里做错了什么?
如果你想要样式,你还需要样式表,如下所示:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css">
Run Code Online (Sandbox Code Playgroud)
这是基础(灰色)主题,还有其他(确保更新版本号!)
除非你需要google.load其他的东西,你可以直接包含脚本,值得查看这个问题,了解使用的优点/缺点google.load().
直接加载它们看起来像这样:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
Run Code Online (Sandbox Code Playgroud)