测试页面以验证 jQuery 代码是否有效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1925905/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 12:25:07  来源:igfitidea点击:

Test page to verify if jQuery code works

jquerytesting

提问by kiamlaluno

Is there a web site that allows to edit a simple HTML fragment, insert jQuery code, and verify if the jQuery code has the desired effect?

是否有允许编辑简单的 HTML 片段、插入 jQuery 代码并验证 jQuery 代码是否具有预期效果的网站?

回答by Rob Sobers

Check out http://www.jsbin.com. Make sure you select jQuery from the "Include:" dropdown.

查看http://www.jsbin.com。确保从“包含:”下拉列表中选择 jQuery。

回答by Amber June

Check out http://jsfiddle.net, it allows you to test languages such as JavaScript, MooTools, jQuery, Prototype, YUI, Glow and Dojo, HTML, and CSS in an online editor. It also has a very slick, clean web2.0 interface and free registration. I highly recommend!

查看http://jsfiddle.net,它允许您在在线编辑器中测试 JavaScript、MooTools、jQuery、Prototype、YUI、Glow 和 Dojo、HTML 和 CSS 等语言。它还有一个非常漂亮、干净的 web2.0 界面和免费注册。我强烈推荐!

回答by Thomas Bonini

I usually use Firebugto test small snippets of jquery. Open any page you want that includes jquery, even the page of this very question, press F12 and run your snippets.

我通常使用Firebug来测试 jquery 的小片段。打开任何你想要的包含 jquery 的页面,甚至是这个问题的页面,按 F12 并运行你的代码片段。

回答by Jim

I suggest http://www.w3schools.com/There are simple tutorials too. Just go to the tutorial and find "try it yourself!" button to start testing.

我建议http://www.w3schools.com/也有简单的教程。只需转到教程并找到“自己尝试!” 按钮开始测试。

回答by Rajan Kumar Kharel

You can try http://plnkr.co/website from which you can write and test your code. It supports for the following library.

您可以尝试http://plnkr.co/网站,您可以从中编写和测试您的代码。它支持以下库。

JQuery JQuery UI Angular JS React.js Bootstrap Backbone.js

JQuery JQuery UI Angular JS React.js Bootstrap Backbone.js