Posted by : Chris London in (Programming, Tutorial)

Testing Javascript On ANY Page

Did you know you can run Javascript on any page? It’s easy. All you do is type javascript: in the navigation bar of your browser and then your Javascript code and it will run it on the page!


Examples

Try the following examples:

javascript:alert('Welcome to Kwista.com!');

javascript:document.write('<img src="http://bit.ly/cc2SsH" />');

Uses

Testing current values of variables. You can test what the current value is of a variable on your page by doing:

javascript:alert(VariableName);

Reenable a Disabled Input Button. Have you been on a site where a button you want to push is disabled? You can use the following code to reenable it:

javascript:document.FormName.ButtonName.disabled = false;

Reenabling Right Click. You can reenable right click of a site with the following code:

javascript:void(document.oncontextmenu=null);

Submitting forms without submit buttons. Have you ever been on a page with a form and the developer forgot to put in a submit button? Well you can use the following to submit the form:

javascript:document.FormName.submit();

Hope you enjoy!

Share and Enjoy:
  • Facebook
  • Twitter
  • Add to favorites
  • email
  • Google Bookmarks

Comments:

Make a comment