开发者

Running jQuery call in Firebug Console

开发者 https://www.devze.com 2022-12-13 03:21 出处:网络
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

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 co开发者_StackOverflownsole. In order to retrieve this value from the page in the console I have to execute:

   document.getElementById('an_element_value').innerHTML

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


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


Just put this before your code in firebug console:

include("jquery");

more...

0

精彩评论

暂无评论...
验证码 换一张
取 消