如何將jQuery添加到JSfiddle ?

[英]How to add jQuery to JSfiddle


The interface of JSfiddle has 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.

謝謝你的幫助。

3 个解决方案

#1


72  

Alternatively to Velimir Tchatchevsky's Answer you can click the Javascript Settings button (top right left of Javascript pane).

對於Velimir Tchatchevsky的回答,您可以單擊Javascript設置按鈕(Javascript窗格的左上角)。

enter image description here

You can select jQuery, and other extensions and frameworks, from the Frameworks & Extensions drop 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等。

enter image description here


In regards to Velimir Tchatchevsky's answer, the External Resources section 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之類的庫。或者您自己托管的CSS / js文件。

#2


5  

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

#3


2  

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的答案在更新的界面中找到了答案。在更新的接口中添加步驟。希望這些能幫助人們在未來尋找同樣的東西

  1. Click on Javascript menu in javascript pane and select jQuery from Frameworks & Extensions menu
  2. 單擊Javascript窗格中的Javascript菜單,從框架和擴展菜單中選擇jQuery。

enter image description here

  1. Add your code using jQuery !!
  2. 使用jQuery添加代碼!

enter image description here


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2016/04/14/7256d72d8e8ea6a5cf3b1a1b5ef2c07.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com