An error has occurred in the script on this page

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Greg Smith
Posts: 209
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

An error has occurred in the script on this page

Unread post by Greg Smith »

Today I made some edits to an old H&M project, rebuilt, and now every page gives me:
An error has occurred in the script on this page
Line: 2
Char : 29928
Error: Object doesn't support property or method 'addEventListener'
Code: 0
URL: mk:@MSITStore:<path to my chm file>::jquery.js

Do you wish to continue running scripts on this page?

Do I need to start a new project from scratch and paste all the pages in?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: An error has occurred in the script on this page

Unread post by Tim Green »

Hi Greg,

This is happening because you are using an older CHM skin and Help+Manual is now including a newer version of the jQuery JavaScript framework with better security. Because of this, your skin needs to be "elevated" to use the current HTML and JavaScript rendering engine in CHM.

You have these two options:

1) Use one of the updated CHM skins included with Help+Manual 8
These all have the necessary elevation and will not cause this issue.

2) Edit the setting in your CHM skin to elevate it to the current version:

1. Open your .hmskin file in Help+Manual and in the Project Explorer on the left, navigate down to Configuration > HTML Page Templates > Default

2. Locate this line of code at the top of the template:

Code: Select all

<IF_HTML><meta http-equiv="X-UA-Compatible" content="IE=edge" /></IF_HTML><IF_CHM>
   <meta http-equiv="X-UA-Compatible" content="IE=8" /></IF_CHM>
It may look slightly different in your skin or may not be there at all. You need to delete both lines and replace them with just this single line, without any <IF_ tags around it:

Code: Select all

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
If the lines are not there at all, just enter this line directly after one of the other <meta... tags towards the top of the template code.

That will fix the problem.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
vladimir shvetsov
Posts: 11
Joined: Thu Dec 27, 2007 8:30 pm

Re: An error has occurred in the script on this page

Unread post by vladimir shvetsov »

Hi, Tim.
I have the same problem as Greg. Unfortunately, both suggested options didn't help in my case.
1) I selected Project -> Publish -> Select Skin. I tryed two skins:
- CHM skin, Dark blue header, Feature images
- HM8-Help-CHM-only
The error message still appears.
2) Eventually this option is not relevant for me, as I have no file *.hmskin at all. Previously I compiled my project with an option "(no skin selected)". I tried the following: Project -> Options -> HTML Page Templates -> Default. Then I added your suggested line to other meta-tags there. The error message still appears.
Please, help me to resolve the problem.
The top of my default page template is now looks like that:
<%DOCTYPE%>
<html>
<head>
<title><%TOPIC_TITLE%></title>
<meta name="generator" content="Help & Manual">
<meta name="keywords" content="<%TOPIC_KEYWORDS%>">
<meta http-equiv="Content-Type" content="text/html; charset=<%DOCCHARSET%>">
<link type="text/css" href="<%STYLESHEET%>" rel="stylesheet">
<link type="text/css" href="custom.css" rel="stylesheet">
<script type="text/javascript" src="nsh.js"></script>
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: An error has occurred in the script on this page

Unread post by Tim Green »

Hi Vladimir,

Just add this line

Code: Select all

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
In this location:

<title><%TOPIC_TITLE%></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="generator" content="Help & Manual">
<meta name="keywords" content="<%TOPIC_KEYWORDS%>">


That should fix it. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
vladimir shvetsov
Posts: 11
Joined: Thu Dec 27, 2007 8:30 pm

Re: An error has occurred in the script on this page

Unread post by vladimir shvetsov »

Hi Tim,
I inserted the line as you explained. Unfortunately, the error remains. I also inserted the same line into the Popup template - didn't help. More over: I translated the project "Get_Me_Started.hmxz", which I received with the H&M installation - the error message appears too. I have just installed Basic Edition Version 8.3.1 Build 5794.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: An error has occurred in the script on this page

Unread post by Tim Green »

vladimir shvetsov wrote: Thu Mar 25, 2021 9:36 am Hi Tim,
I inserted the line as you explained. Unfortunately, the error remains.
This is strange and I can't reproduce it anywhere. What version of Windows and Internet Explorer are you running?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
vladimir shvetsov
Posts: 11
Joined: Thu Dec 27, 2007 8:30 pm

Re: An error has occurred in the script on this page

Unread post by vladimir shvetsov »

Actually I use rather old version of Windows on my notebook: Windows 7 Home, Service pack 1, Internet Explorer 8.0.7601.
Just now I installed H&M on a desktop computer with Windows 10, and the error has gone.
The problem for me is that I prefer to work on a notebook, and due to some reasons I don't want to upgrade my notebook now. Is it any option for me to use H&M8 in my old system? Perhaps, I could use some conditional tags, so that my project would compile in both Windows7 or Windows10?
User avatar
Darren Rose
Posts: 204
Joined: Sat Mar 03, 2012 3:01 pm

Re: An error has occurred in the script on this page

Unread post by Darren Rose »

Or perhaps just update Internet Explorer from version 8 (12 years old) to version 11 (7 years old and updated as recently as November 2020)
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: An error has occurred in the script on this page

Unread post by Tim Green »

Your old IE is the problem (and I hope you're not going online with it...) because the CHM viewer is effectively IE with a different interface. As Darren noted, you just need to update to IE 11, which Windows 7 supports. You really, really, really should not be using IE 8 any more. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
vladimir shvetsov
Posts: 11
Joined: Thu Dec 27, 2007 8:30 pm

Re: An error has occurred in the script on this page

Unread post by vladimir shvetsov »

Tim and Darren, thank you. I upgraded to IE 11, and the problem is solved. (Actually I never use IE, my browser is Firefox, that is why IE was so out of date on my computer.)
Post Reply