在Firebug控制台中运行jQuery调用 [英] Running jQuery call in Firebug Console

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

问题描述

对不起,新的Firebug。我真的发现能够在Firebug控制台窗口中运行javascript有帮助。但是,我似乎不能在控制台中运行jQuery调用。例如,在我的页面中执行javascript时,我可以调用获取一个值:

Sorry, new to Firebug. I really find being able to run javascript in the Firebug console window helpful. However, I don't seem to be able to run jQuery calls in the console. For example, in my executing javascript in my page, I may make the call to get a value:

   jQuery('#an_element_value').text()

但是,我无法在控制台中执行。为了从控制台中的页面检索这个值,我必须执行:

However, I cannot execute this in the console. In order to retrieve this value from the page in the console I have to execute:

   document.getElementById('an_element_value').innerHTML

有没有办法通过jQuery在Firebug控制台中执行jQuery调用和引用页面元素? / p>

Is there a way to execute jQuery calls and reference page elements through jQuery in the Firebug console?

推荐答案

像其他人说的,它不会工作,除非你有jquery包含在页面上。但是,您可以在包含此书签的任何网页上轻松添加jQuery: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet

Like others have said, it wont work unless you have jquery included on the page. However, you can easily include jQuery on any page with this bookmarklet: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet

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

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