Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

04 November 2010

Defeat Firefox popup blocker

What a hack!

Today I was exploring a hack to web browser. The goal of the hack is simple: to open up an infinite number of popup windows. All I did is a simple javascript with a few functions that cause endless recursion. The only tricky part is what 'name' should be given to the window to be open and avoiding using a timing event to give chance for popup blocker to defend.

The result is my firefox browser opened an countless number of windows and crashed eventually. Also, I ran the same script with Chrome browser; chrome couldn't defend this attack either. After this little experiment, I just realized how vulnerable our web browser is and how dangerous the WEB could be.

26 October 2010

JavaScript - Popups

Posted from Diigo. The rest of my favorite links are here.

The link above shows you a step-by-step procedure of creating popup windows (not tabs!) using only Javascript.

22 October 2010

jQuery effects

Hide, Show, Toggle, Slide, Fade, and Animate. WOW! With all these, you already can create quite an interactive web pages! Amazing jQuery!

http://www.w3schools.com/jquery/jquery_effects.asp

Okay, enough of jQuery lessons for today!

jQuery selector concept

In HTML DOM terms:

Selectors allow you to manipulate DOM elements as a group or as a single node.

jQuery Element Selectors

jQuery uses CSS selectors to select HTML elements.


$("p") selects all elements.
$("p.intro") selects all elements with class="intro".
$("p#demo") selects the first element with id="demo".


jQuery Attribute Selectors

jQuery uses XPath expressions to select elements with given attributes.


$("[href]") select all elements with an href attribute.


$("[href='#']") select all elements with an href value equal to "#".


$("[href!='#']") select all elements with an href attribute NOT equal to "#".


$("[href$='.jpg']") select all elements with an href attribute that ends with ".jpg".

jQuery syntax for selecting HTML elements

The jQuery syntax is tailor made for selecting HTML elements and perform some action on the element(s).

Basic syntax is: $(selector).action()

  • dollar sign to define jQuery
  • (selector) to "query (or find)" HTML elements
  • jQuery action() to be performed on the element(s)

Examples:

$(this).hide() - hides current element

$("p").hide() - hides all paragraphs

$("p.test").hide() - hides all paragraphs with class="test"

$("#test").hide() - hides the element with id="test"


P.S. jQuery uses a combination of XPath and CSS selector syntax.

19 August 2010

Javascript Animation Tutorial

I made my first Javascript animation today! So cool ...

Anyway, here is a tutorial on basic concepts about javascript animation:

http://tinyurl.com/2l2cj2

27 July 2010

A small javascript to do integer factorization

http://www.cs.columbia.edu/~hh2360/htmls/prime_factor.html

A small practice on Javascript. I will change the interface to make it more user-friendly. Right now it is just a working script sitting there for handy use.