August 17, 2012

Debugging in Firebug

Question by frazzle

Wonder if anyone can give some advice.

Bascially this is something I come across from time to time – I’m learning to debug using firebug and trying to track down where a style attribute is being set in a complex bunch of wordpress/fancy box files.

Bascially I’m trying to get fancybox to autosize to width of element, I know the fancybox option to enable this, but the whole box seems to be overriding with a fixed width, which i can’t find anywhere in the stylesheets.

element.style {
border-width:10px;
height:84px;
width:987px;

Now, this doesn’t have a style sheet associated on the right hand side in firebug, so I’m assuming this means its computed on the fly somewhere in the js/php ?

What I’m after is a pointer on how to track down where it’s being set, and how I can maybe use firebug to identify that if it’s being set outside the stylesheets? it’s so I can be a better debugger too 🙂 thanks for looking.

Answer by Starx

  1. First locate the element
  2. Once you do this, trigger the event, you will see the change
May 3, 2012

is there a way to disable javascript debugging on a live server

Question by kayfun

Is there a way to tell debugging tools (firebug and the likes) never to be enabled for your website regardless of user’s browser configurations?

Answer by Konstantin Pribluda

no.

client is free to do whatever it sees fit with your javascript. You may try to obfuscate – but this is not effective against determined developers

Answer by Starx

Scripts, HTML, CSS, Images everything is loaded to the client before the page opens. So he can do anything he likes with what he has in his system. There is no way to disable it.

Even If there is a possibility of doing such, he can remove that as well.

So, basically its a wasted effort.

January 2, 2012

"var_dump" functions

Question by Joseph the Dreamer

by the function name itself, var_dump() dumps everything about a provided parameter EXCEPT the functions of an object.

is there a way of dumping out these functions?

Answer by zerkms

You cannot get the object’s methods, but you can get the class methods:

var_dump(get_class_methods('classname'));

or

var_dump(get_class_methods(get_class($object)));

Answer by Starx

You can use ReflectionClass API too

An Example:

$cls = new ReflectionClass("classname");
var_dump($cls -> getMethods());
...

Please fill the form - I will response as fast as I can!