如何将 jQuery 添加到 JSfiddle
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36620565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to add jQuery to JSfiddle
提问by kh.tab
The interface of JSfiddlehas changed and i can't see any option to add jQuery
, and set it onLoad
as it was Before..
JSfiddle的界面发生了变化,我看不到任何添加选项jQuery
,并将其设置onLoad
为之前的样子。
So can someone help me how to activate it.
那么有人可以帮助我如何激活它。
And thank you for help.
并感谢您的帮助。
回答by ImClarky
Alternatively to Velimir Tchatchevsky's Answeryou can click the Javascript Settingsbutton (top rightleft of Javascript pane).
另外,以韦利米尔Tchatchevsky的回答,您可以点击JavaScript设置按钮(上右左窗格中的Javascript的)。
You can select jQuery, and other extensions and frameworks, from the Frameworks & Extensionsdrop down.
您可以从“框架和扩展”下拉列表中选择 jQuery 和其他扩展和框架。
Also, depending on the library selected there are also some other extensions to that library. An example below of jQuery 1.7.2, you can also include jQuery UI, jQuery Mobile etc.
此外,根据选择的库,该库还有一些其他扩展。下面是 jQuery 1.7.2 的示例,您还可以包含 jQuery UI、jQuery Mobile 等。
In regards to Velimir Tchatchevsky's answer, the External Resourcessection on the left is more for importing other files / libraries that JSFiddle does not have.
关于 Velimir Tchatchevsky 的回答,左侧的外部资源部分更多地用于导入 JSFiddle 没有的其他文件/库。
For example, you could import libraries like FontAwesome or Datatables.js, or your own hosted CSS / JS files.
例如,您可以导入 FontAwesome 或 Datatables.js 等库,或您自己托管的 CSS / JS 文件。
回答by Velimir Tchatchevsky
At the left side there is an "external resources" button that you can click and fill in the url of the jquery source
左侧有一个“外部资源”按钮,可以点击填写jquery源的url
回答by mry
Had the same question. using ImClarky's answer figured it out in updated interface. Adding steps in updated interface. hope these help someone looking for same in future
有同样的问题。使用 ImClarky 的答案在更新的界面中找到了答案。在更新的界面中添加步骤。希望这些可以帮助将来寻找相同的人
- Click on Javascript menu in javascript pane and select jQuery from Frameworks & Extensions menu
- 单击 javascript 窗格中的 Javascript 菜单,然后从 Frameworks & Extensions 菜单中选择 jQuery
- Add your code using jQuery !!
- 使用 jQuery 添加您的代码!