473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Strange behavior with IE when writing a script that writes another script

Hello,

I have some problems with a Javascript that should redirect me to
another page, it works fine most of the times but sometimes it hangs
on a blank page.

I made lots of tests and finally I could reproduce the bug with this
little piece of code:

<script>
document.writeln("<scr"+"ipt>location='http://www.microsoft.com/';</scr"+"ipt>");
</script>

(I know it is unusual (and unnecessary) to write a script that writes
another script, but it's returned that way by a server I don't
control).

This script works. But if you use the back button more than 12 times,
then it won't work anymore. You 'll get a blank page.

Is this a feature or a bug? Do you know how to avoid that?

Thanks in advance,
Benoit Fries
Jul 20 '05 #1
1 1404
Benoit Fries wrote:
I have some problems with a Javascript that should redirect me to
another page,
That's a Bad Thing, see below.
it works fine most of the times but sometimes it hangs on a blank page.

I made lots of tests and finally I could reproduce the bug with this
little piece of code:

<script>
The `type' attribute is missing.
document.writeln("<scr"+"ipt>location='http://www.microsoft.com/';</scr"+"ipt>");
No concatenation is required here but the
ETAGO delimiter `</' should be escaped: `<\/'.
</script>

(I know it is unusual (and unnecessary) to write a script that writes
another script, but it's returned that way by a server I don't
control).
More, it is not recommended because of the Netscape Run Length
Bug (NRLB). Try that in Netscape 4.x and you get broken code
sometimes.
This script works.
Depends.
But if you use the back button more than 12 times,
then it won't work anymore. You 'll get a blank page.

Is this a feature or a bug?
I do not know since you do not explain why you hit the `Back' button
this much and from which document(s) you are navigating to which.
Do you know how to avoid that?


Use server-side redirection, this also does not break the `Back' button.
PointedEars
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: Dmitriy Iassenev | last post by:
hi, I found an interesting thing in operator behaviour in C++ : int i=1; printf("%d",i++ + i++); I think the value of the expression "i++ + i++" _must_ be 3, but all the compilers I tested...
4
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
3
by: Christoph Zwerschke | last post by:
Just hitting a strange problem with Python import behavior. It is the same on all Python 2.x versions and it is probably correct, but I currently don't understand why this happens. I have...
10
by: weichaoliu | last post by:
I know that this problem is concerned to GCC. But I hope somebody here can tell me some detailed things about why. The version of g++ I'm using is: g++ (GCC) 3.4.4 (mingw special). The code is:...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
12
by: John | last post by:
I can't get my head around this! I have the following code: <% .... Code for connection to the database ... .... Code for retrieving recordset ... If Not rs.EOF Then ... Do something...
3
by: Chuck Renner | last post by:
Please help! This MIGHT even be a bug in PHP! I'll provide version numbers and site specific information (browser, OS, and kernel versions) if others cannot reproduce this problem. I'm...
3
by: t_rectenwald | last post by:
I've noticed an oddity when running a program, using the csv module, within IDLE. I'm new to Python so am confused by what is happening. Here is what I'm doing: 1) Open the IDLE Shell. 2)...
20
by: Pilcrow | last post by:
This behavior seems very strange to me, but I imagine that someone will be able to 'explain' it in terms of the famous C standard. -------------------- code -----------------------------------...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.