ie7 problem

Discussion in 'Javascript' started by Bob, Nov 22, 2006.

  1. Bob

    Bob Guest

    Hello,

    The following function is failing in ie7. Can anyone offer a solution?


    function pause(numberMillis) {
    if (IEVERSION >= 5.5) {
    var dialogScript = 'window.setTimeout(function () {
    window.close(); }, ' + numberMillis + ');';
    var result =
    window.showModalDialog('javascript:document.writeln("<script>'+dialogScript+'</script>")');
    }
    Bob, Nov 22, 2006
    #1
    1. Advertising

  2. Bob

    web.dev Guest

    Bob wrote:
    > Hello,
    >
    > The following function is failing in ie7. Can anyone offer a solution?


    You have not given a context in which you are trying to achieve with
    the code given.

    > function pause(numberMillis) {
    > if (IEVERSION >= 5.5) {


    How are you obtaining the version number? Is it even reliable?

    > var dialogScript = 'window.setTimeout(function () {
    > window.close(); }, ' + numberMillis + ');';
    > var result =
    > window.showModalDialog('javascript:document.writeln("<script>'+dialogScript+'</script>")');


    Generally good practice to place a type attribute:

    <script type = "text/javascript">

    The string '</script>' is causing the browser to think that this is
    where the script actually ends. Escape the slash:

    <\/script>
    web.dev, Nov 22, 2006
    #2
    1. Advertising

  3. Bob

    Bob Guest

    Thanks for your reply. Th IEVERSION variable is set in another area.
    It does seem to work ok. The problem I'm having with the code is that
    it infinitely executes. By that I mean, it is being called repeatedly
    (like a sleep function) to allow form field processing to be handled.
    Problem only on ie7.

    web.dev wrote:
    > Bob wrote:
    > > Hello,
    > >
    > > The following function is failing in ie7. Can anyone offer a solution?

    >
    > You have not given a context in which you are trying to achieve with
    > the code given.
    >
    > > function pause(numberMillis) {
    > > if (IEVERSION >= 5.5) {

    >
    > How are you obtaining the version number? Is it even reliable?
    >
    > > var dialogScript = 'window.setTimeout(function () {
    > > window.close(); }, ' + numberMillis + ');';
    > > var result =
    > > window.showModalDialog('javascript:document.writeln("<script>'+dialogScript+'</script>")');

    >
    > Generally good practice to place a type attribute:
    >
    > <script type = "text/javascript">
    >
    > The string '</script>' is causing the browser to think that this is
    > where the script actually ends. Escape the slash:
    >
    > <\/script>
    Bob, Nov 22, 2006
    #3
  4. Bob

    Bob Guest

    I believe that I've isolated the problem to showModalDialog. Is this a
    known problem with ie7? Is there an alternative to showModalDialog?
    Thanks.
    Bob wrote:
    > Thanks for your reply. Th IEVERSION variable is set in another area.
    > It does seem to work ok. The problem I'm having with the code is that
    > it infinitely executes. By that I mean, it is being called repeatedly
    > (like a sleep function) to allow form field processing to be handled.
    > Problem only on ie7.
    >
    > web.dev wrote:
    > > Bob wrote:
    > > > Hello,
    > > >
    > > > The following function is failing in ie7. Can anyone offer a solution?

    > >
    > > You have not given a context in which you are trying to achieve with
    > > the code given.
    > >
    > > > function pause(numberMillis) {
    > > > if (IEVERSION >= 5.5) {

    > >
    > > How are you obtaining the version number? Is it even reliable?
    > >
    > > > var dialogScript = 'window.setTimeout(function () {
    > > > window.close(); }, ' + numberMillis + ');';
    > > > var result =
    > > > window.showModalDialog('javascript:document.writeln("<script>'+dialogScript+'</script>")');

    > >
    > > Generally good practice to place a type attribute:
    > >
    > > <script type = "text/javascript">
    > >
    > > The string '</script>' is causing the browser to think that this is
    > > where the script actually ends. Escape the slash:
    > >
    > > <\/script>
    Bob, Nov 22, 2006
    #4
  5. Bob

    Guest

    It's not a problem. This script is a hack. I'm sure they tightened it
    up in ie7. We'll have to find an alternative way to pause on a
    different thread.

    Bob wrote:
    > I believe that I've isolated the problem to showModalDialog. Is this a
    > known problem with ie7? Is there an alternative to showModalDialog?
    > Thanks.
    > Bob wrote:
    > > Thanks for your reply. Th IEVERSION variable is set in another area.
    > > It does seem to work ok. The problem I'm having with the code is that
    > > it infinitely executes. By that I mean, it is being called repeatedly
    > > (like a sleep function) to allow form field processing to be handled.
    > > Problem only on ie7.
    > >
    > > web.dev wrote:
    > > > Bob wrote:
    > > > > Hello,
    > > > >
    > > > > The following function is failing in ie7. Can anyone offer a solution?
    > > >
    > > > You have not given a context in which you are trying to achieve with
    > > > the code given.
    > > >
    > > > > function pause(numberMillis) {
    > > > > if (IEVERSION >= 5.5) {
    > > >
    > > > How are you obtaining the version number? Is it even reliable?
    > > >
    > > > > var dialogScript = 'window.setTimeout(function () {
    > > > > window.close(); }, ' + numberMillis + ');';
    > > > > var result =
    > > > > window.showModalDialog('javascript:document.writeln("<script>'+dialogScript+'</script>")');
    > > >
    > > > Generally good practice to place a type attribute:
    > > >
    > > > <script type = "text/javascript">
    > > >
    > > > The string '</script>' is causing the browser to think that this is
    > > > where the script actually ends. Escape the slash:
    > > >
    > > > <\/script>
    , Dec 28, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Botha
    Replies:
    0
    Views:
    1,690
    Chris Botha
    Dec 30, 2006
  2. =?Utf-8?B?ZHBvbXQ=?=

    Problem with ASP.NET menu (position:fixed) in IE7

    =?Utf-8?B?ZHBvbXQ=?=, Jan 26, 2007, in forum: ASP .Net
    Replies:
    9
    Views:
    1,815
    Steven Cheng[MSFT]
    Feb 22, 2007
  3. Replies:
    0
    Views:
    542
  4. Jeff Louella

    IE7 on XP vs IE7 on Vista

    Jeff Louella, Mar 1, 2007, in forum: HTML
    Replies:
    9
    Views:
    512
    Adrienne Boswell
    Mar 2, 2007
  5. Mtmartin71
    Replies:
    9
    Views:
    819
    Adrienne Boswell
    Aug 28, 2007
Loading...

Share This Page