Page 1 of 1

** SOLVED ** Code error when published using a masterframe

Posted: Tue Apr 20, 2021 5:52 am
by bubblegumweb
Hi all,

I have created a small demo website using a masterframe. Within the masterframe header I have a small contact form. When the website is published I am getting the typical display of code at the top of the page which normally indicates that the page is in the wrong format ie: HTML when it should be PHP. The masterframe page is set at PHP but I am still getting the error code at the top of the page.

I have tried publishing the masterframe page with the settings (Don't publish this page) and (publish this page) but still getting the error code? I have cleared cache in my browser to test each version on the publish or not bit but can't get rid of this error code.
Any idea's please how to correct this.

Here is the demo website: https://www.visionwebdesign.co.uk/ironing/

Thanks

Re: Code error when published using a masterframe

Posted: Tue Apr 20, 2021 6:03 am
by Pablo
You will need to set the extension of the 'index' page to PHP.
https://www.visionwebdesign.co.uk/ironing/index.html
should be
https://www.visionwebdesign.co.uk/ironing/index.php

Re: Code error when published using a masterframe

Posted: Tue Apr 20, 2021 6:16 am
by bubblegumweb
Pablo, your a star. All is fine now. Thanks.

Re: Code error when published using a masterframe

Posted: Wed Apr 28, 2021 1:13 pm
by Jaywhy
I have the same problem, the extension is already set to PHP. Any other ideas?
The page is www.blessedlandscapes.com
I also disabled 'Generate external JS file for page specific JavaScript' as Pablo suggested in a previous post.

Re: Code error when published using a masterframe

Posted: Wed Apr 28, 2021 1:24 pm
by BaconFries
It is more than likely that you have more than one index file on the server. Please ensure you do not have a .index.html along with a .index.php (remove the index.htmI) I also noticed that the index is set to index.js this indicates that the server is misconfigured. To resolve this either contact your host / server and ask them to fix it. Or Disable 'Generate external JS file for page specific JavaScript' in Tools -> Options -> HTML

Re: Code error when published using a masterframe

Posted: Wed Apr 28, 2021 10:24 pm
by Jaywhy
Thanks for your reply. When I delete the index.html file the whole page is gone and it just shows the following coding:

$(document).ready(function()
{
$("a[href*='#header']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#wb_header').offset().top }, 600, 'linear');
});
$("a[href*='#intro']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#intro').offset().top }, 600, 'easeOutSine');
});
$("a[href*='#mosaic']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#mosaic').offset().top }, 600, 'easeOutSine');
});
$("a[href*='#about']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#about').offset().top }, 600, 'easeOutSine');
});
$("a[href*='#details']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#details').offset().top }, 600, 'easeOutSine');
});
$("a[href*='#contact-title']").click(function(event)
{
event.preventDefault();
$('html, body').stop().animate({ scrollTop: $('#wb_contact-title').offset().top }, 600, 'easeOutSine');
});
$(document).on('click','.ThemeableMenu1-navbar-collapse.in',function(e)
{
if ($(e.target).is('a') && ($(e.target).attr('class') != 'dropdown-toggle'))
{
$(this).collapse('hide');
}
});
});

Also, I already have disabled 'Generate external JS file for page specific JavaScript' in Tools -> Options -> HTML.
And I talked to the host and they said that the problem is on the coding not on index.js

Any other ideas are very much welcome!

Re: Code error when published using a masterframe

Posted: Thu Apr 29, 2021 6:24 am
by Pablo
The problem is with the configuration of the server. The server should not use index.js as the landing page.

To work around this issue you will need to:
- remove index.js from the server.
- make sure JavaScript is embed in the page: Disable 'Generate external JS file for page specific JavaScript' in Tools -> Options -> HTML

Re: Code error when published using a masterframe

Posted: Mon May 03, 2021 2:41 am
by Jaywhy
Thank you, Pablo and Baconfries! The problem is solved. :D