Skip navigation.

miscoded

the web is a hack

useful JS snippets

, ,

To see all direct properties and methods of an object (does not recurse):

function objinspect(obj){var s='';for(var e in obj)s+=e+':'+obj[e]+'\n';opera.postError(s);}


Call it with the object you want to look at, for example objinspect(window); .

To emulate the document.load method in Opera:
if(!Document.prototype.load){
    Document.prototype.load=function(uri){
        if(this.documentElement){this.removeChild(this.documentElement);}
        var doc=(document.implementation.createLSParser( document.implementation.MODE_SYNCHRONOUS, null )).parseURI(uri);
        this.appendChild(this.importNode(doc.documentElement, true));
    }
}


BTW, why does Mozilla's document.load documentation claim that this method is from the DOM3 Load and Save spec when it isn't mentioned there?

To see all code that will be passed to eval() before evaluating it:

window.eval=(function(e){return function(s){opera.postError(s);return e(s);}})(window.eval);

how to shoot yourself in the menu with a variablekey events

Comments

Hallvord R. M. Steen 12. April 2006, 12:39

Um, "illegal use of eval" error. That's what I get for blogging *while* working rather than *after*. window.eval=window.alert; gets you only so far..

Jeroen Hoekx 14. April 2006, 11:12

BTW, why does Mozilla's document.load documentation claim that this method is from the DOM3 Load and Save spec when it isn't mentioned there?



It was in an old working draft : http://www.w3.org/TR/2003/WD-DOM-Level-3-LS-20030619/load-save.html#LS-DocumentLS

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies