-
1. Re: Charset declaration in template must be before 512 bytes of data
Liam Dilley Oct 8, 2012 12:25 AM (in response to thetrickster888)Hey,
Using the editor in the admin for your templates? Do not have the issue to get HTML5 as HTML5 my end. Dont touch things in the admin layout and template wise.
You can see here:
<!DOCTYPE html>
<html lang="en">
<!-- BC_OBNW --><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
From:
http://www.gettalking.co.nz/index.htmlBC stuff is not moving that around at all. But like I said, I do not go into the editor at all for this stuff, Not designed to do coding in. It is only XHTML compliant so does not know HTML5.
Actually I can tell your using the edito because you have the wrong declaration:
<html xmlns="http://www.w3.org/1999/xhtml">
Your using XHMTL not html5.
-
2. Re: Charset declaration in template must be before 512 bytes of data
thetrickster888 Oct 8, 2012 7:51 AM (in response to Liam Dilley)I'm not using the Admin editor to code my template. If you'd read my thread you'd see that I noted that BC is adding the xml namespace attribute on my html element. I don't have that in the code on my template. Also, I'm talking about the charset meta tag, not the http-equiv meta tag. You can still use the http-equiv meta tag to set the charset but the HTML5 spec also says that we can use the new charset meta tag instead and that it be in the first 512 bytes of data. The Here's my template doctype and head elements:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mortgage Unlimited, LLC</title>
<link rel="stylesheet" href="/stylesheets/mortgage-unlimited.css">
<link rel="stylesheet" href="/stylesheets/easy.css">
<script src="//www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.7.1");
google.load("jqueryui", "1.8.17");
</script>
<script src="/scripts/main.js"></script>
<script>
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<script>
function validate()
{
if (document.frmLoanOfficer.selLoanOfficerId.value == "")
{
alert("Please select a Mortgage Banker");
document.frmLoanOfficer.selLoanOfficerId.focus();
return false;
}
}
</script>
<script language="JavaScript" type="text/javascript">
function validateQuote(){
var objForm = document.getElementById("frmquote");
if(objForm.loanType.value==""){
alert("Please select Type of Loan");
objForm.loanType.focus();
return false;
}
if(objForm.creditHistory.value==""){
alert("Please select Credit History");
objForm.creditHistory.focus();
return false;
}
if(objForm.monthlyExpenses1.value==""){
alert("Please select Property Value");
objForm.monthlyExpenses1.focus();
return false;
}
if(objForm.loanAmount1.value==""){
alert("Please select Loan Amount");
objForm.loanAmount1.focus();
return false;
}
if(objForm.FirstName.value==""){
alert("Please enter First Name");
objForm.FirstName.focus();
return false;
}
if(objForm.LastName.value==""){
alert("Please enter Last Name");
objForm.LastName.focus();
return false;
}
if(objForm.Email.value==""){
alert("Please enter Email");
objForm.Email.focus();
return false;
}
if(objForm.Phone.value==""){
alert("Please enter Phone");
objForm.Phone.focus();
return false;
}
}
</script>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
</head>
And here's my page doctype and head elements:
<!DOCTYPE html>
<html>
<head>
<title>Mortgage Unlimited, LLC</title>
<meta name="keywords" content="Mortgage Unlimited, LLC, home loan, mortgage, home purchase, refinance, debt consolidation, mortgage calculator, low interest rate, low mortgage rate, home finance, secure online mortgage application, home equity loan, bad credit, pre-qualify, equity line of credit,branch affiliate, net branch, branch partner, wholesale lending, retail mortgages, branch platform, branch, mortgage branch,pre approval, real estate lending, real estate loans, commercial loans,FHA Loans, 3.5% down, low down payment financing , hard money loans, ">
<meta name="description" content="Mortgage Unlimited, LLC offers mortgage and refinance services for home owners and home buyers. Experienced mortgage professionals providing full mortgage related services.
">
</head>
I could just update my http-equiv meta tag to include the charset but I think this is a bug since in the future most people will be using the charset meta tag instead of the http-equiv tag so whatever processes the templates are run under that are moving the http-equiv meta tags to the top of the header should also be configured to work with the charset meta tag as well. I'm still considering this a bug.
-
3. Re: Charset declaration in template must be before 512 bytes of data
thetrickster888 Oct 8, 2012 8:57 AM (in response to thetrickster888)If anyone on the BC team can look into this issue, I'd appreciate it. It's not major but the problem should be addressed. We need to get BC to conform to HTML5 as much as possible.
-
4. Re: Charset declaration in template must be before 512 bytes of data
Liam Dilley Oct 8, 2012 1:36 PM (in response to thetrickster888)Like I showed, it must be something your doing, i can just do that meta and not the content type and you can see it is the first thing in the head of that site and others we have created. So it is not BC just doing it.
You got to look at your setup to see why.
-
5. Re: Charset declaration in template must be before 512 bytes of data
thetrickster888 Oct 8, 2012 1:46 PM (in response to Liam Dilley)I don't think you understand. I know that you can add <meta http-equiv="charset=utf-8"> to the page code or template code and BC moves that meta tag up toward the top. BUT-- I'm trying to add <meta charset="utf-8"> to the template. In my template it's the first thing just after the <head> tag as I showed in my code paste above. When I add the charset meta tag, it gets moved from where I have it to toward the end of the <head> siblings.
The HTML5 working draft says that besides passing the charset into the http-equiv meta tag, you can also use the new charset meta tag. I'm saying that this is a bug and if there's a charset meta tag present it should be placed first in the <head> element, above any http-equiv meta tags since the other requirement for the charset meta tag is that it is in the first 512 bytes of data.



