Block certain html/js from loading on a webpage

I am making a firefox extension, which are written in js/xul

and i was wondering if its possible for the javascript part of the code to tell Firefox to NOT load a certain part of the code, for example, a fuction, or full string of code.

thank you for any help,
joey