473,739 Members | 4,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

after prompting I got "unspecifie d error"

I have the following code in the event onbeforeunload

if ( typeof executingPostBa ck != 'undefined' && !executingPostB ack )
event.returnVal ue = ""Warning: Modified data has not been saved."";

executingPostBa ck is a global variable.

I have another function for another event trying to access an object as
follows:

window.location .href = targetObj.href;

everything is OK, but it raises the "unspecifie d error" when I click
cancel in the popup confirmation window.

anyone gets experience of this ?

thank you very much!

Apr 10 '06 #1
6 5168
so*********@gma il.com wrote:
I have the following code in the event onbeforeunload

if ( typeof executingPostBa ck != 'undefined' && !executingPostB ack )
event.returnVal ue = ""Warning: Modified data has not been saved."";

^^ ^^
String literals are to be delimited by only one <"> or <'> character.
PointedEars
Apr 10 '06 #2
VK

so*********@gma il.com wrote:
I have the following code in the event onbeforeunload

if ( typeof executingPostBa ck != 'undefined' && !executingPostB ack )
event.returnVal ue = ""Warning: Modified data has not been saved."";

executingPostBa ck is a global variable.

I have another function for another event trying to access an object as
follows:

window.location .href = targetObj.href;

everything is OK, but it raises the "unspecifie d error" when I click
cancel in the popup confirmation window.


Not me: by my observations onbeforeupload handler works smoothly.
"Unspecifie d error" usually meand that you managed to twist the engine
totally for all 360deg, so it doesn't remember its name and the year
anymore :-)

This line make me suspitious:
window.location .href = targetObj.href;
-not by itself but because you call it "access an object". You are not
accessing an object, you are navigating away from the current page to
the targetObj.href location. If you have onbeforeunload confirmation
already pending for user interaction, add some more pending events...
add a bit of fantasy... I guess it is possible to produce "Unspecifie d
error". :-)

Could you narrow you problem to some minimum (but self-contained) code?

Apr 10 '06 #3
ooops~

sorry, that's a typo
ignore that, 'cause i am using some code-behind to output the script

Apr 10 '06 #4
thanks for your reply. but why if I click [OK] in the confirmation
window, everything works fine?

my code actually tends to do some hotkey stuffs:

I creates several functions for my links, for example:

function fndnn_ctr407_Re latedData_PageN av_CancelButton Keyup(event)
{
var b =
document.getEle mentById('dnn_c tr407_RelatedDa ta_PageNav_Canc elButton');
Hotkey(event, b, false, false, true, 67);
}
if (document.addEv entListener)
document.addEve ntListener('key up',
fndnn_ctr407_Re latedData_PageN av_CancelButton Keyup, true);
else
document.attach Event('onkeyup' ,
fndnn_ctr407_Re latedData_PageN av_CancelButton Keyup);

there are several other functions, ie. for Save button, etc.

they are all attached to the onkeyup event, and I also have an event
for onbeforeunload.

my hotkey function is as follows:

function Hotkey(event, targetObj, ctrlKey, shiftKey, altKey, keycode)
{
if (processing) return;

processing = true;

if (
targetObj
&& event.ctrlKey == ctrlKey
&& event.shiftKey == shiftKey
&& event.altKey == altKey
&& event.keyCode == keycode
)
{
// if we need to post back
if (targetObj.href && targetObj.href. indexOf('doPost Back')>0)
{
executingPostBa ck = true;
window.location .href = targetObj.href;
}
else if (targetObj.oncl ick)
{
targetObj.click ();
}
else
{
window.location .href = targetObj.href;
}

}

processing = false;
}

When the user clicks [Add] button, I assumes the page is modified, then
I register the onbeforeunload event to prompt the user.
Everything works fine, but it fails when the user clicks [Cancel] in
the confirmation window. The error happens at that line trying to
access targetObj.

any idea?

Thanks

Apr 10 '06 #5
HaHa!

it works

after I use this :

var url = targetObj.href;
try
{
window.location .href = url;
}
catch (e)
{
// do nothing
}

Apr 10 '06 #6
so*********@gma il.com wrote:
it works

after I use this :

var url = targetObj.href;
try
{
window.location .href = url;
}
catch (e)
{
// do nothing
}


Note that this will break in IE < 5.0. Maybe you are looking for

window.location = url;

instead.
PointedEars
Apr 10 '06 #7

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

Similar topics

1
1514
by: DRIZAII | last post by:
I am wondering if anyone has come across this problem. I have a huge VC6 project (C++ Win32 DLLs, .dsp, .dsw), and when I tried to open the project through Visual Studio .NET 2003, it offered to convert the project to a newer format. I said ok, but after that the devstudio has been spewing out these error messages with no further description. Have you come across this? Can you think of what caused this? The error is a simple message...
3
1916
by: joseph | last post by:
When I perform "Copy Project" in VS.NET 2003 sometimes I got "Unspecified Error" error in a pop-up. My colleague also has this problem. Is it something to do with the network or to do with SourceSafe? Thanks
0
1204
by: GaryB | last post by:
Using ADO (VB6),Access 2000, MDAC 2.8, under Win2K, if I simply run 3 computers simultaneously INSERTing a single record into a single table on the server PC (adoConn.Execute strSQL) at a rate of about 1 per 4 seconds, eventually I'll get the infamous "Unspecified Error". Usually after 3000 to 5000 records. It can happen on any of the machines and will eventually happen to all. Restarting the application fixes it for awhile, 'till it...
2
1952
by: VB Programmer | last post by:
I created a ASP.NET app locally and it works great. Uploaded it to my server and I get this error when trying to view a page. Any ideas? Server Error in '/earlyalert3' Application. ---------------------------------------------------------------------------- ---- Compilation Error
10
3730
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file
0
1235
by: ratsekil via AccessMonster.com | last post by:
Pls Help ! "Unspecified error" ------------------------------------------------------------------------------ -- I'm using Windows Server 2003, making the webpages with ASP+Access(2000) When I load some of the pages, it warns me like that: -----------------------------------------------
0
1647
by: Jonathan | last post by:
Hi Everyone, I have a problem which I've been able to reproduce with a nice and small test ASP.NET web application. The page sets the window.onbeforeunload event so that we will get an Ok/Cancel dialog box to prompt users before navigating away from the page. There are many different types of input buttons on the page (e.g. asp:Button, asp:ImageButton, asp:LinkButton, asp:DropDownList, asp:CheckBox) and most of them work fine. However,...
0
1795
by: fniles | last post by:
I am using VB.Net 2003 and MS Access database. Sometimes when I open the database, I got the error "Unspecified error" The application validate users, when it validates users, it reads from a table in the database. I use connection pooling by opening the database in Form_Load, then everytime somebody comes in, I open the database and reads from it to validate the user. I then close the database. How can I fix this "Unspecified error" ?...
1
1199
by: SD007 | last post by:
I am using C#.Net 2005 and Access 2000 and I am getting an error called "Unspecified Error" at the time of execution of a query. Can anybody help me to solve this problem?
0
8792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8215
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6754
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6054
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.