added try in java script and return some error codes when needed. Added register to web pages as simple way of interacting with them
tow pages that register them self as page_a and page_b