pufAmuf
pufAmuf

Reputation: 7805

Execute a Jquery function from browser to debug?

is it possible to execute a jquery function in a firefox window? For example, let's say I want to do:

$.fn.colorbox.resize();

Thank you :)

Upvotes: 1

Views: 940

Answers (2)

Mark Schultheiss
Mark Schultheiss

Reputation: 34217

Just to show "action" I would just put a border around something:

$(myselector).css("border","red solid 3px");

OR if that messed with layout:

$(myselector).css('background-color","lime");

Upvotes: 1

Loktar
Loktar

Reputation: 35319

Assuming you mean the console, as long as jQuery is loaded on the page you can use jQuery in the console to test. If its not loaded on the page you can use the below bookmarklet to load it first

javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.getElementsByTagName('body')[0].appendChild(s);alert('thank you for using jquery!');void(s);

Original Bookmarklet link

Upvotes: 2

Related Questions