Posts tagged “tricks”.

Javascript Tricks

Javascript enjoys its presence on the internet due to its age and wide support.

Here are some snippets that you may find useful.

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

Paste this over the url of a webpage, and you will be able to edit the text like notepad. The source code will be updated when you save it as a file. Tested in IE7 and Firefox 3.




javascript:document.getElementsByTagName("embed")[0].SetVariable("moviename.somevariablename", 12345)

This snippet will allow you to change the variable inside a flash movie. To find out what the movie or variable names are, you will need the source code, or use a flash decompiler.

Note that if the flash file isn’t in the “embed” tag, then you will need to find the appropriate tag name.

The [0], indicates that it is the first embed tag on the page. If you are trying to locate the 5th embed tag, then you would replace [0] with [4].

Leave a Comment »