Simple Marketo form on external website not working | Community
Skip to main content
Level 2
January 29, 2025
Solved

Simple Marketo form on external website not working

  • January 29, 2025
  • 1 reply
  • 987 views

Can someone help to correct this script which is not loading the Page at all

<html> <head> <title>Embed Marketo Form</title> </head> <body> <h1>Test to load Marketo Form - not working</h1> <script src="//pages.sjsu.edu/js/forms2/js/forms2.min.js"></script> <form id="mktoForm_2031"></form> <script>MktoForms2.loadForm("//pages.sjsu.edu", "663-UKQ-998", 2031, function (form){MktoForms2.lightbox(form).show();});</script> </body> </html>

 

It does not show the Marketo Form when I browse to this page on Chrome.

What is wrong here? 

Best answer by SanfordWhiteman

Of course! Browsers place restrictions on localhost that prevent it from perfoming key actions.

 

You always want to develop with real local HTTP server of some kind. Simple Web Server is great for this.

1 reply

SanfordWhiteman
Level 10
January 29, 2025

Well, that embed code works fine on a test page. What’s the URL of your page?

sg-3Author
Level 2
January 29, 2025

I have that script on a page and tried to view the page using Chrome.

-It is not hosted on any Webserver
-Just browsing to the page did not work..


I think it has to be hosted by a Web Server, Just browsing to that page did not work

 

 

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
January 29, 2025

Of course! Browsers place restrictions on localhost that prevent it from perfoming key actions.

 

You always want to develop with real local HTTP server of some kind. Simple Web Server is great for this.