dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Problem with Javascript function calling blur() . . .

  1. #1
    Join Date
    Mar 2013
    Posts
    1

    Problem with Javascript function calling blur() . . .

    Ok, the real problem occurs in our Oracle/Forms application calling back to the Internet Explorer 7 browser windows HTML/Javascript function.

    However, I have managed to recreate the problem with 2 simple Internet explorer 7 .htm files. I managed to replace the Oracle form app with "sub.htm" and still have the problem.

    The symptom is that my "main.htm" has 2 simple functions in it. One is called onload in the main.htm. This first function can call blur(), moveto() or close() successfully, but here I have it just calling resize(). It works fine.

    Then there is a link that starts "sub.htm". Its onload calls a function in the parent "main.htm" javascript named resize_me_blur(). The purpose is to move the parent window and blur it to hide it. In this second function, I can resize, moveto or even close the parent window, but the blur() function does nothing to the parent window or anything else.

    I have tried this with IE7 on XP and IE8 on win 7.

    I am new to HTML and Javascript so I figure I am missing the obvious. . .

    Thanks
    ================================================

    <!DOCTYPE html>
    <html>
    <script>
    function resize_me(){
    window.resizeTo(400,400);
    }
    function resize_me_blur(){
    window.resizeTo(400,200);
    window.blur()
    }
    </script>
    <body onload="resize_me();">
    <h1>My First Heading</h1>
    <a href="c:\personal\html\sub.htm" TARGET="_blank">GoSub</a>
    </body>
    </html>


    <!DOCTYPE html>
    <html>
    <script>
    function callback(){
    window.opener.resize_me_blur();
    }
    </script>
    <body onload="callback()";>
    <h1>My sub window</h1>
    <button style="width:100;height:100" onClick="window.close()">GoBack!</button>
    </body>
    </html>

  2. #2
    Join Date
    Nov 2010
    Posts
    1,102
    I don't know that blurring the parent window will actually do anything. Maybe focusing the child would be a better approach?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles