Embedded Form: Script Load Error in IE Emulation Mode (IE8)

New Contributor

Hello I am a web developer implementing an embedded form on an existing web page.   I have the following code snippet embedded in the body of my page:

 

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
css: '',
portalId: '2527126',
formId: 'eff1474e-a054-4249-a740-1ea9e111de4a',
onFormReady: function ($form, options) {
(logic here)
},
onFormSubmit: function ($form) {
(logic here)
}
});
</script>

No problems when I'm attempting to load v2.js.   However, when I switch to run in IE8 emulation mode in IE, I get this error:

SCRIPT70: Permission denied
v2-legacy.js (1,1126)

This is when I am running locally, if that makes a difference.

Reply
0 Upvotes
4 Replies
Community Manager

Hey @mlholt03 could you please provide a link to the page that you are embedding the form on?

Reply
0 Upvotes
New Contributor

Hi @roisinkirby, this form is currently in development on my local machine only (localhost).   I have not deployed this web site to a public-facing server, as I am wanting to eliminate issues such as this before exposing it to my end users.

Reply
0 Upvotes
Community Manager

Ah I see! Was hoping to troubleshoot further with some of HubSpot's Design Support Specialists. How are you currently testing in IE?

 

Common problems are often that the onFormReady and/or onFormSubmit functions are causing conflict with IE. 

Reply
0 Upvotes
New Contributor

Hello, I was pulled off in another direction for a bit yesterday, so I am just now returning to this; thanks for your continued support.

 

I am testing in IE in three manners.  First, I am using IE 11 for Windows 10 - I am using the Emulation Mode in the Developer Toolbar to replicate IE 8.   Second, I am using Browserstack to emulate IE 8 in Windows XP.   Third, I am using Microsoft Edge to emulate IE 8.   This issue that I'm seeing only seems to be occurring when I use IE in Emulation mode.   When I switch to emulate IE 9 (in either IE or Edge,) I do not see any script errors in the console, presumably because the conditional markup is loading the non-legacy script.

 

Also, with regards to my callbacks, the logic within them is as follows:

hbspt.forms.create({
css: '', portalId: '2527126', formId: 'eff1474e-a054-4249-a740-1ea9e111de4a', onFormReady: function ($form, options) { $('#formModal').on('shown.bs.modal', function () { $.placeholder.shim(); }); }, onFormSubmit: function ($form) { $('.form-wrapper').css('height', $form.css('height')); } });

"form-wrapper" is the parent div in my markup of the script tag which contains the above snippet (and thus the form after being created and inserted into my site).   "formModal" is again my markup, so I am not making any changes to the form after being initialized.  

 

That said, I also can reproduce this issue even if I completely remove the onFormReady and onFormSubmit handlers altogether.

Reply
0 Upvotes