Archive for January, 2012

Chrome is not showing frame border

 

I have frameset with

   1: frameborder="yes"

attribute.  It works well in IE and FF (showing borders between frames) but not in Chrome.

 

Workaround very simple  — just delete attribute completely. Now it working in all browsers.

onfocus not working in Chrome

That is. I am just trying to adjust some old project, working fine only in IE8, to Firefox and Chrome.

 

Workaround very simple  –  change onfocus to onclick.

click() not working in Chrome

 

I have code like

   1: var link = document.getElementById("myLink");

   2: link.click();

and it is working in all browsers (really tested in IE8 and FF9) but not in Chrome.

 

Stackoverflow has three questions about this issue without workaround.

http://stackoverflow.com/questions/5015893/onclick-parent-getelementbyid-click-not-working-in-chrome

http://stackoverflow.com/questions/1938356/chrome-browser-action-click-not-working

http://stackoverflow.com/questions/7857289/click-not-working-in-chrome

People speak about some security limits.

And voila – solution:

   1: var link = document.getElementById("myLink"); //existing code

   2: $(link).click();

or pure jQuery style:

   1: $("#myLink").click();

jQuery rules!!

How to close parent window in Firefox and Chrome

.. and possible also in Opera, Safari etc.

The problem:

   1: parent.window.close();

that working well in IE8 but not working in Firefox and Chrome. Some state that for security reasons.

Solution (lol):

   1: top.window.close();

 

A little more details:

I have a page that opens popup using showModalDialog(….) function.

Inside popup i have a frameset(old project) with two frames. One of them have button which onclick="parent.window.close()" not working in FF but onclick="top.window.close()" successfully closes popup.

 

If You american citizen do something with SOPA because it can be "ZHOPA".

Good Luck!