javascript:resizeTo(1024,768);
A colleague suggested to the testers they enter javascript:resizeTo(1024,768); into the address bar after starting the app to test it in the smallest browser dimensions for which we are responsible. However, shortly after executing this command (in IE6), the backspace and delete keys stopped working and users could not cut-and-paste.
Why is this happening? In ge开发者_高级运维neral, should users avoid enter javascript:xxx commands into the address bar? Thanks.
It's just a kind of bookmarklet that he's suggested typing in directly. I wouldn't expect it to cause any trouble, although with IE6 I wouldn't guarantee that the address bar having changed wouldn't cause a problem. To get around that, just give them a page with
<a href='javascript:resizeTo(1024,768);'>bookmark this</a>
...on it and have them right-click and bookmark that. Then they can use it from their bookmarks without changing the address bar.
But you'd be better off with a proper resizing tool. Search for "browser resizer" to find some (I can't recommend a specific one).
I bet it was pure chance. Typing that code into the location bar is roughly equivalent to executing it from the page source and that executed statement only resizes current window.
精彩评论