Jquery ui Gmail上下文小工具,无法获取要显示的jQueryUI按钮

Jquery ui Gmail上下文小工具,无法获取要显示的jQueryUI按钮,jquery-ui,gmail-contextual-gadgets,Jquery Ui,Gmail Contextual Gadgets,让jQueryUI工作/初始化Gmail小工具规范文件CDATA部分中的基本按钮时遇到问题 以下是规范文件CDATA部分的第一部分 问题是,当alert()运行时,.button()调用对html按钮没有任何作用 我也试过了。按钮(“刷新”)没有用 <Content type="html" view="card"> <![CDATA[ <style type="text/css" src="https://ajax.googleapis.com/ajax/libs/j

让jQueryUI工作/初始化Gmail小工具规范文件CDATA部分中的基本按钮时遇到问题

以下是规范文件CDATA部分的第一部分

问题是,当alert()运行时,.button()调用对html按钮没有任何作用

我也试过了。按钮(“刷新”)没有用

<Content type="html" view="card">
<![CDATA[
  <style type="text/css" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css"></style>
  <!-- Start with Single Sign-On -->      
  <script type="text/javascript" src="http://example.com/gadgets/sso.js"></script>
  <!-- jQuery -->
  <!-- Check for latest .. https://developers.google.com/speed/libraries/devguide -->
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
  <p>Version 11</p>

  <button type="submit" id="test-button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">Button</span></button>
  <script type="text/javascript">$(function() { $("#test-button").button(); alert("why?"); } );</script>

版本11

按钮 $(函数(){$(“#测试按钮”).button();警报(“为什么?”;});
我错过了什么吗?

您需要在最后一行的
测试按钮
选择器前面有一个
,因为
测试按钮
按钮
id

您还有比创建按钮所需的标记多得多的标记。尝试更改此行:

<button type="submit" id="test-button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">Button</span></button>
按钮

按钮

按钮
插件将负责添加所有类以及它需要的类。

好的,那么。。丢脸。问题是jqueryUI样式没有正确导入

而不是“我需要使用”
<link rel="stylesheet" type="text/css" media="screen, projection" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css"/>


谢谢你的回答,但是(请参阅更新的代码)实际上没有任何区别。我已经有了#,是的。没有骰子。我在我的答案中添加了一些希望会有帮助的内容。谢谢TJ。我发现了问题。
<link rel="stylesheet" type="text/css" media="screen, projection" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css"/>