473,410 Members | 1,952 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,410 software developers and data experts.

Restoring window.event in IE

3
Hi everybody!

I have a question regarding IE. I have a client using a script (which I can not change as it is an affiliate program's script that I can not control) that creates a variable called "event" and assigns a number to it. This is the line:

Expand|Select|Wrap|Line Numbers
  1. var event=7348734;
Later on, there is another script that should use window.event, but... it does not work, because window.event gets rewritten by the previous script and it stays filled by the number!!!

In your opinion, is there a way to empty the "event" variable, and restore it to its original state, including srcElement?
I have tried setting:
Expand|Select|Wrap|Line Numbers
  1. event = null;
  2. event = window.event
  3.  
This resulted in having window.event value back to null, and its type as object (as it should be). But srcElement will not work :-(

Any suggestions? Thanks in advance!
Simone
Feb 8 '08 #1
5 1797
mrhoo
428 256MB
null always returns 'object' from typeof, because it is not 'undefined'.

IE doesn't give you access to a constructor or prototype for event.

I never thought of trying to assign event to something,
but I gave it a whirl in IE7:
window.event=33
and got a 'member not found' error- but event was untouched.
I don't have any old IE's around, so I don't know what they may do.
Feb 8 '08 #2
sdt76
3
I can't imagine the purpose of the 'affiliate' script, unless it is to discourage event handling in IE.
unfortunately not... it is just a variable they arbitrarily called "event" without thinking about it :-(

I'll make some tests... thanks anyway!

cheers
s
Feb 8 '08 #3
acoder
16,027 Expert Mod 8TB
Interesting. I don't know why it's not made read-only. This affects IE7 too.

Is there no possibility of changing the script?
Feb 9 '08 #4
sdt76
3
Interesting. I don't know why it's not made read-only. This affects IE7 too.

Is there no possibility of changing the script?
unfortunately, that script is not under my control... and although it looks silly calling a variable "event", IE is absolutely more silly by allowing that to rewrite window.event!

Anyway, for the moment, changing the script looks like the only viable solution...

thanks everybody for your help! This just looks like another IE "feature" we will have to remember :)
Feb 12 '08 #5
acoder
16,027 Expert Mod 8TB
unfortunately, that script is not under my control... and although it looks silly calling a variable "event", IE is absolutely more silly by allowing that to rewrite window.event!

Anyway, for the moment, changing the script looks like the only viable solution...

thanks everybody for your help! This just looks like another IE "feature" we will have to remember :)
True, I'll have to add it to the list of bugs. Thanks for bringing this up.
Feb 12 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Barry | last post by:
Retoring Caret Position after text field correction -------------------------------------------------------------------------------- Hi, my code has the following form - function...
10
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
1
by: Tom | last post by:
I have a large application; lots of forms, multiple dynamic DLLs, etc. I also have, in the appliation, a general 'Preferences' class object (which is in itself a separate DLL, and I just include a...
4
by: Együd Csaba | last post by:
Hi, the restoration of a dump stops at the line above. The dump was created with pgsql 7.3.2 and I need to pump it into a 7.4.3 one. Should anybody tell me what the problem can be and how I can...
2
by: David McDivitt | last post by:
Rather than have several different pages, an app was designed to have different sections, all on one page. To get to the different sections the browser is scrolled down. It may take several submits...
1
by: Robbert van Geldrop | last post by:
Hello, I have a problem restoring Exchange 2000 files. Our software has an interface to ESEBCLI2.dll for online backup and restore features. Everything works fine with Exchange 2003 and also...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
1
by: rjha94 | last post by:
$db2evmon -db DEV1926 -evm DB2DETAILDEADLOCK was showing data from all the runs whereas i want the data just for a single run. To capture fresh events, I deleted the old events file. caveat was, I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.