Print Page | Close Window

JavaScript - Exception Occured

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12323
Printed Date: 28 March 2026 at 4:56pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: JavaScript - Exception Occured
Posted By: VBScript
Subject: JavaScript - Exception Occured
Date Posted: 26 October 2004 at 4:20pm

Error '80020009'

Exception Occured

Does anyone know how to solve this problem?

Here is the sorce code:-

function createLink() {
 if (isHTMLMode) {
  alert("Please uncheck 'Edit HTML'");
  return;
 }
 cmdExec("CreateLink");
}




Replies:
Posted By: Gullanian
Date Posted: 26 October 2004 at 4:51pm
What line is the error on?


Posted By: MadDog
Date Posted: 26 October 2004 at 9:44pm
maybe return; needs to be return false;

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: VBScript
Date Posted: 27 October 2004 at 5:14am

It still doesnt work the exact line of the error is

if (isHTMLMode) {

Also does anyone know how to stop IE from cashing a page.



Posted By: Mart
Date Posted: 27 October 2004 at 5:47am

Are you sure that isHTMLMode is a boolean?



Posted By: VBScript
Date Posted: 27 October 2004 at 5:51am
Yes. The code has been used before in my script and I have just copied it because it is part of my Rich Text Editor


Posted By: Mart
Date Posted: 27 October 2004 at 5:54am

Before that line type

alert(isHTMLMode);

and reply with that the alert box says



Posted By: VBScript
Date Posted: 27 October 2004 at 6:07am

function createLink() {
alert(isHTMLMode);   <--- Line 157
 if (isHTMLMode) {
  alert("Please uncheck 'Edit HTML'");
  return false;
 }
 cmdExec("CreateLink");
}

I still get the same error



Posted By: Mart
Date Posted: 27 October 2004 at 6:23am
I meant tell me what it says when the alert pops up, it should be true or false


Posted By: VBScript
Date Posted: 27 October 2004 at 6:39am
The error occures on the message box line!!


Posted By: Semikolon
Date Posted: 27 October 2004 at 2:08pm
then it's probably something wrong with the isWHATEVERITWAS variable

are you sure you copied the complete code? maybe you missed an important part of it


Posted By: Mart
Date Posted: 27 October 2004 at 2:31pm

Originally posted by VBScript VBScript wrote:

The error occures on the message box line!!

Which message box line? the one I asked you to put in for debug purposes? Re-read my question



Posted By: VBScript
Date Posted: 28 October 2004 at 5:19am

you asked me to put an alert() thing in

it causes an error with that line



Posted By: VBScript
Date Posted: 28 October 2004 at 5:32am

Don't worry I have solved that problem, but how do I stop a browser from cashing a page?



Posted By: Mart
Date Posted: 28 October 2004 at 6:01am

If were talking about IE its impossible lol

 

what do you mean by chrashing the page? Do you mean when you get a JS error and it shows the error dialog or something?



Posted By: Gullanian
Date Posted: 28 October 2004 at 6:35am
I think he means cache.

Put this ASP in:

<%
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>



Posted By: VBScript
Date Posted: 28 October 2004 at 6:49am

Thanks Gullanian.


 



Posted By: dpyers
Date Posted: 28 October 2004 at 2:22pm
It's almost impossible to prevent all instances of page caching but the method gullanian posted is the best solution available.
If your audience is very technical though, they may haved played with settings enough to defeat it. Also, some "speed" internet services for dial-up use modified browsers and/or non-standard caches for performance

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: VBScript
Date Posted: 29 October 2004 at 6:08am
It was for my own forum login page because i didnt want the browser to cache it


Posted By: Mart
Date Posted: 29 October 2004 at 6:33am

Another solution is to put some random characters in the querystring, because the URL changes each time it will not be cached by proxy servers etc. something like

<a href=mypagethatisnotcached.asp?CachePreventer=<%= Guid.NewGuid.ToString%>>My non cached page</a>

That will only work in ASP.NET but its the same principal for ASP




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net