使用JSFiddle从javascript控制台调用jQuery [英] Call jQuery from javascript console when using JSFiddle

查看:132
本文介绍了使用JSFiddle从javascript控制台调用jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的调试和创建过程中,典型的是从javascript控制台(firefox或chrome内置的firebug)中消除几个jQuery命令,仅用于检查和测试。我注意到,我无法使用jQuery()调用与JSFiddle中的页面中的任何元素进行交互,并且$()的行为不正常(我猜这是绑定到mootools或X其他框架?)查看页面上使用的脚本列表,告诉我jQuery库是加载的。任何有关如何调用jQuery(body)简单的方法的任何想法。从firebug或chrome javascript控制台?任何简单的方法来找出jQuery的绑定?



不是有必要的,但是这里是一个jsfiddle,使用jQuery进行测试。 http://jsfiddle.net/HHecw/



谢谢!

解决方案

您正在jsFiddle框架中直接使用控制台。

jsFiddle使用MooTools而不是jQuery。



要从控制台与您的页面进行交互,您需要直接从 http://fiddle.jshell.net/HHecw/show/light/


It's typical in my debug and creation process to fire off a few jQuery commands from the javascript console (firebug in firefox or chrome's built-in) just for inspection and testing purposes. I've noticed that I'm unable to interact with any elements in the page on JSFiddle using the jQuery() call, and that $() doesn't behave normally either (I'm guessing it's bound to mootools or X other framework?) Looking at the list of scripts used on the page tells me that the jQuery library is loaded.

Any ideas on how I can call something as simple as jQuery("body").toggle("slow"); from the firebug or chrome javascript console? Any simple way to find out jQuery's binding?

not that it's necessary, but here is a jsfiddle using jQuery for your testing purposes. http://jsfiddle.net/HHecw/

Thanks!

解决方案

You're using the console directly in the jsFiddle frame.
jsFiddle uses MooTools, not jQuery.

To interact with your page from the console, you need to open the "result" frame directly, from http://fiddle.jshell.net/HHecw/show/light/

这篇关于使用JSFiddle从javascript控制台调用jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆