Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > ie7 problem

Reply
Thread Tools

ie7 problem

 
 
Bob
Guest
Posts: n/a
 
      11-22-2006
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.writel n("<script>'+dialogScript+'</script>")');
}

 
Reply With Quote
 
 
 
 
web.dev
Guest
Posts: n/a
 
      11-22-2006

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.writel n("<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>

 
Reply With Quote
 
 
 
 
Bob
Guest
Posts: n/a
 
      11-22-2006
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.writel n("<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>


 
Reply With Quote
 
Bob
Guest
Posts: n/a
 
      11-22-2006
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.writel n("<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>


 
Reply With Quote
 
sagesmith@gmail.com
Guest
Posts: n/a
 
      12-28-2006
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.writel n("<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>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 and IE7 64-bit in Vista 64-bit 007 Windows 64bit 1 10-28-2008 08:46 PM
Problem w/ Text Alignment - IE7 Problem Only Mtmartin71 HTML 9 08-28-2007 06:31 AM
How do I setup a 32 bit IE7 since I'm using a 64 Bit IE7 =?Utf-8?B?RXVnZW5l?= Windows 64bit 3 05-06-2007 01:18 PM
IE7 on XP vs IE7 on Vista Jeff Louella HTML 9 03-02-2007 02:25 AM
ReportViewer and dynamic size with IE7 problem Chris Botha ASP .Net 0 12-30-2006 06:32 PM



Advertisments