473,396 Members | 2,050 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,396 software developers and data experts.

AttachEvent - permission denied ?

Using asp.net 2003

When I use

document.attachEvent("onmousemove", resetTimer);

The first time into a page, it works fine, but the 2nd time the page is
loaded (not postback) it gives a permission denied error.. any ideas why ?

Thanks
-Adrian
Jul 23 '05 #1
6 4050


Adrian Parker wrote:
Using asp.net 2003

When I use

document.attachEvent("onmousemove", resetTimer);

The first time into a page, it works fine, but the 2nd time the page is
loaded (not postback) it gives a permission denied error.. any ideas why ?


You usually get that error message when your script tries to access a
document in another frame or window it doesn't have access to due to the
same origin policy only allowing access to window/frames with documents
being loaded from the same host/domain.
Are you using any frames or popup windows, does resetTimer try to access
data in another window/frame?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
> You usually get that error message when your script tries to access a
document in another frame or window it doesn't have access to due to the
same origin policy only allowing access to window/frames with documents
being loaded from the same host/domain.
Are you using any frames or popup windows, does resetTimer try to access
data in another window/frame?


I am using frames, but the pages in the other 2 frames do not have this code
in them.

Here's the code.. first time in is ok, it's the 2nd time the page is loaded
that has the problem with the attachevent.

<script>

var SRV_IDLE_TIME = 1200000;
var srv_timerID = -1;
var CLI_IDLE_TIME = 900000;
var cli_timerID = -1;

// On page load, start times and set focus
function onLoading() {
startTimer();
placeFocus();
}

// Clear timers when page unloaded
function onUnloading() {
if (cli_timerID != -1) {
clearTimeout(cli_timerID);
}
if (srv_timerID != -1) {
clearTimeout(srv_timerID);
}
}

// Start Timers
function startTimer() {
cli_timerID = window.setTimeout("timeOut()",CLI_IDLE_TIME);
srv_timerID = window.setTimeout("timeOut()",SRV_IDLE_TIME);
}

// Restart the client side inactivity timer
function resetTimer() {
if (cli_timerID != -1) {
clearTimeout(cli_timerID);
cli_timerID = window.setTimeout("timeOut()",CLI_IDLE_TIME);
}
}

// Client side inactivity timeout
function timeOut() {
if (cli_timerID != -1) {
clearTimeout(cli_timerID);
}
cli_timerID = -1;
if (srv_timerID != -1) {
clearTimeout(srv_timerID);
}
srv_timerID = -1;
location.href='logout.aspx';
}

function placeFocus() {
if( Form1.elements[0]!=null) {
var i;
var max = Form1.length;
for( i = 0; i < max; i++ ) {
if( Form1.elements[ i ].type != "hidden" &&
!Form1.elements[ i ].disabled &&
!Form1.elements[ i ].readOnly &&
(Form1.elements[ i ].type == "text" ||
Form1.elements[ i ].type == "textarea") ) {
Form1.elements[ i ].focus();
break;
}
}
}
}

document.attachEvent("onmousemove", resetTimer);
document.attachEvent("onclick", resetTimer);
document.attachEvent("onkeydown", resetTimer);

</script>

<body onload="onLoading();" onunload="onUnloading();" .....etc


Jul 23 '05 #3


Adrian Parker wrote:

I am using frames, but the pages in the other 2 frames do not have this code
in them.

Here's the code.. first time in is ok, it's the 2nd time the page is loaded
that has the problem with the attachevent.


Odd, there is indeed nothing in the code that tries to access another
frame and could therefore cause a permission denied. I don't know why
you get the error.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
On Sat, 18 Sep 2004 17:07:05 +0200, Martin Honnen <ma*******@yahoo.de>
wrote:
Adrian Parker wrote:
I am using frames, but the pages in the other 2 frames do not have this code
in them.

Here's the code.. first time in is ok, it's the 2nd time the page is loaded
that has the problem with the attachevent.


Odd, there is indeed nothing in the code that tries to access another
frame and could therefore cause a permission denied. I don't know why
you get the error.


I've seen this sort of thing recently onload, never seen it with my
code so never looked into it - I think it may be related to IE doesn't
fully recompile the code on an F5 refresh if the docs haven't changed.

It'd be good to reproduce a test-case and finally look at this I think
- can the OP get the files on line - preferably reduced to the minimum
that exhibits the problem.

Jim.
Jul 23 '05 #5
> I've seen this sort of thing recently onload, never seen it with my
code so never looked into it - I think it may be related to IE doesn't
fully recompile the code on an F5 refresh if the docs haven't changed.

It'd be good to reproduce a test-case and finally look at this I think
- can the OP get the files on line - preferably reduced to the minimum
that exhibits the problem.

Jim.


Hmm.. this is odd.. same code running on a non-dev win2k box runs fine.
my dev box is running win2k sp2.

I'll try to mock up a single page with the script on it.

-Adrian
Jul 23 '05 #6
Finally found the problem. At server side I was doing a response.redirect
which doesn't work properly.. if I change it to use server.transfer it works
fine.
Jul 23 '05 #7

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

Similar topics

1
by: Klunk | last post by:
Hi, last week I moved the folder of my Intranet application to another disk of the same server. After this change all the ASP page return this error: Microsoft VBScript runtime error...
1
by: Mark E. Hamilton | last post by:
Sorry, I probably should have re-stated the problem: We're using Python 2.3.5 on AIX 5.2, and get the follow error messages from some of our code. I haven't yet tracked down exactly where it's...
10
by: Florian G. Pflug | last post by:
Hi I installed a postgres-application (which was developed on debian woody) on red hat 9 today, using the postgres 7.3 rpms from redhad. One of my the triggers uses the pg_settings table (more...
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
4
by: xzzy | last post by:
I have a v1.1 web app that works on my local computer. However, running it at the host computer, the following breaks: when a viewer selects a different country, the State dropdown should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.