Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 9th Dec 2011, 07:10 PM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Hi, I'm trying to validate a mobile site I'm working on in the W3C mobileOK Checker.

I'm getting a couple of issues that I'd like to fix, but I'm not sure how.

1. "The document is served without caching information ("Expires" or "Cache-Control" header)"


2. "The HTTP Content-Type header does not specify a character encoding and no UTF-8 encoding or a non-UTF-8 is specified in the XML declaration"

Any ideas how to fix these two issues? The documentation it links to is a little confusing.

thanks


W3C mobileOK Checker
dshipman is offline  
Unread 9th Dec 2011, 07:29 PM   #2
Digital Marketer
War Room Member
 
WillR's Avatar
 
Join Date: 2010
Location: Australia
Posts: 12,475
Thanks: 1,984
Thanked 8,187 Times in 4,079 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

1. Try adding this line in the head section of the page:

<meta http-equiv="Cache-Control" content="max-age=600" />

2. You need a line like this in the head section of the page:

<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />

WillR is offline  
The Following User Says Thank You to WillR For This Useful Post:
Unread 9th Dec 2011, 07:46 PM   #3
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by WillR View Post

1. Try adding this line in the head section of the page:

<meta http-equiv="Cache-Control" content="max-age=600" />

2. You need a line like this in the head section of the page:

<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />

Thanks, my index file already has the <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> in the head, so I'm not sure why it's giving me the error.

I'll add the cache-control one since I didn't have that already.

thanks for your help.
dshipman is offline  
Unread 9th Dec 2011, 07:58 PM   #4
I Do Voice Over Work
War Room Member
 
rlhurst's Avatar
 
Join Date: 2011
Location: Oregon
Posts: 581
Thanks: 34
Thanked 129 Times in 96 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by emergemma View Post

Thanks, my index file already has the <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> in the head, so I'm not sure why it's giving me the error.

.
I was having the same error even though I had that line in there too. Then, I found if you put this line as your very first line (even above the !Doctype line).... it "passed"

<?xml version="1.0" encoding="UTF-8" ?>

Also, keep the meta one in there too (in the head section)... it takes both. Now, I'm not going to pretend like I'm some coding expert. I just did some searching around and found out this works. Someone more knowledgeable can explain why!!

I do voice over work... here's a SAMPLE
rlhurst is offline  
The Following User Says Thank You to rlhurst For This Useful Post:
Unread 9th Dec 2011, 08:10 PM   #5
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by rlhurst View Post

I was having the same error even though I had that line in there too. Then, I found if you put this line as your very first line (even above the !Doctype line).... it "passed"

<?xml version="1.0" encoding="UTF-8" ?>

Also, keep the meta one in there too (in the head section)... it takes both. Now, I'm not going to pretend like I'm some coding expert. I just did some searching around and found out this works. Someone more knowledgeable can explain why!!
That worked! thank you
dshipman is offline  
Unread 9th Dec 2011, 08:15 PM   #6
I Do Voice Over Work
War Room Member
 
rlhurst's Avatar
 
Join Date: 2011
Location: Oregon
Posts: 581
Thanks: 34
Thanked 129 Times in 96 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by emergemma View Post

That worked! thank you
You're welcome

I do voice over work... here's a SAMPLE
rlhurst is offline  
Unread 9th Dec 2011, 08:28 PM   #7
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

I've got one other question. Would either of you (or anyone) know of a way to reduce the file size of a css file? I'm using jquerymobile for the site and it has a huge css file that's affecting the total size of the page.

My images are small, my index.html is small. I'm just having trouble with the massive css file.

It's not a huge deal. I'm at 62% on the W3C checker, so it's not completely failing.

thanks
dshipman is offline  
Unread 9th Dec 2011, 08:32 PM   #8
I Do Voice Over Work
War Room Member
 
rlhurst's Avatar
 
Join Date: 2011
Location: Oregon
Posts: 581
Thanks: 34
Thanked 129 Times in 96 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by emergemma View Post

I've got one other question. Would either of you (or anyone) know of a way to reduce the file size of a css file? I'm using jquerymobile for the site and it has a huge css file that's affecting the total size of the page.

My images are small, my index.html is small. I'm just having trouble with the massive css file.

It's not a huge deal. I'm at 62% on the W3C checker, so it's not completely failing.

thanks
What are the sizes of your images.... and what's the size of the css file?
You should be way better than 62% imo

I do voice over work... here's a SAMPLE
rlhurst is offline  
Unread 9th Dec 2011, 08:44 PM   #9
Digital Marketer
War Room Member
 
WillR's Avatar
 
Join Date: 2010
Location: Australia
Posts: 12,475
Thanks: 1,984
Thanked 8,187 Times in 4,079 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by emergemma View Post

I've got one other question. Would either of you (or anyone) know of a way to reduce the file size of a css file? I'm using jquerymobile for the site and it has a huge css file that's affecting the total size of the page.

My images are small, my index.html is small. I'm just having trouble with the massive css file.

It's not a huge deal. I'm at 62% on the W3C checker, so it's not completely failing.

thanks
62% is still pretty low and not something that will just be fixed by reducing the images and CSS file.

In regards to reducing the size of the CSS file you can use a CSS compressor. They will strip out all the unnecessary white space etc. There are several free ones online such as this:
CSS Compressor

For reducing the size of your images I use GIFbot:
GIFbot

WillR is offline  
The Following User Says Thank You to WillR For This Useful Post:
Unread 9th Dec 2011, 08:47 PM   #10
I Do Voice Over Work
War Room Member
 
rlhurst's Avatar
 
Join Date: 2011
Location: Oregon
Posts: 581
Thanks: 34
Thanked 129 Times in 96 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by WillR View Post

In regards to reducing the size of the CSS file you can use a CSS compressor. There are several free ones online such as this:
CSS Compressor
Hey Will, would linking to an external css file fix the size problem?

I do voice over work... here's a SAMPLE
rlhurst is offline  
Unread 9th Dec 2011, 08:49 PM   #11
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by rlhurst View Post

What are the sizes of your images.... and what's the size of the css file?
You should be way better than 62% imo
My file sizes are as follow:
index file: 2.6kb
images: 14.5kb
style sheets: 44.2kb

My most major error is this: "The CSS style sheet is not syntactically valid CSS", so I checked the w3c css validator and it's saying things like text-shadow and corner radius doesn't exist in css 2.1, but exists in css 2 and css 3.

The CSS style sheet comes from jquerymobile. the jquerymobile mobile site also gets a low score, so maybe they haven't updated to the w3c standards yet.
dshipman is offline  
Unread 9th Dec 2011, 08:50 PM   #12
Web Marketing For Profit
War Room Member
 
Quentin's Avatar
 
Join Date: 2002
Location: Brisbane
Posts: 2,895
Thanks: 8
Thanked 1,162 Times in 528 Posts
Blog Entries: 10
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

If you use the jquery it will almost always access the google api which will drag your score down to about 65 or less because it contains a lot of images.

You can check this by clicking on the various score and below it will say where and if you click on this it will provide where it is falling down.

It is always a compromise between whether you want validation or an interactive site.

Those that go the validation route often sacrifice looks and experience for speed which is good if that is what the customer wants.

Quentin

Quentin is offline  
Unread 9th Dec 2011, 08:52 PM   #13
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by rlhurst View Post

Hey Will, would linking to an external css file fix the size problem?
I'm currently using an external style sheet.
dshipman is offline  
Unread 9th Dec 2011, 09:02 PM   #14
Digital Marketer
War Room Member
 
WillR's Avatar
 
Join Date: 2010
Location: Australia
Posts: 12,475
Thanks: 1,984
Thanked 8,187 Times in 4,079 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by rlhurst View Post

Hey Will, would linking to an external css file fix the size problem?
No, it doesn't make a difference where you host it. The page still needs to load that CSS content regardless of where it is hosted. The only way to improve the CSS file is to remove all the styles that you are not using and to run it through a compressor.

Originally Posted by emergemma View Post

My most major error is this: "The CSS style sheet is not syntactically valid CSS", so I checked the w3c css validator and it's saying things like text-shadow and corner radius doesn't exist in css 2.1, but exists in css 2 and css 3.
Yes, the W3C validator doesn't seem to like CSS3. But that's most likely because there are still a lot of browsers out there that do not support CSS3. I wouldn't worry so much about those warnings.

From an end-user standpoint though, make sure that your site still looks good and is easy to read if CSS3 styles were disabled.

Originally Posted by Quentin View Post

It is always a compromise between whether you want validation or an interactive site.

Those that go the validation route often sacrifice looks and experience for speed which is good if that is what the customer wants.
Exactly. There is nothing that says you HAVE to score a certain percentage however obviously being able to show potential clients the difference using the 3rd party validator can often be a good selling point.

You also need to remember the W3C standards were introduced for a reason. They are the standards that most developers of browsers, etc will follow so the more you can adhere to those standards yourself, the greater the number of devices your site will work across.

It's a juggling act at the end of the day and there is no right or wrong answer. Whatever works best for you is the right answer.

WillR is offline  
Unread 9th Dec 2011, 09:09 PM   #15
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 155
Thanks: 111
Thanked 16 Times in 15 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by WillR View Post


Yes, the W3C validator doesn't seem to like CSS3. But that's most likely because there are still a lot of browsers out there that do not support CSS3. I wouldn't worry so much about those warnings.

From an end-user standpoint though, make sure that your site still looks good and is easy to read if CSS3 styles were disabled.


Okay, thanks. Yes, I checked it out in Internet Explorer and it still looks good. Just missing the rounded edges.
dshipman is offline  
Unread 9th Dec 2011, 09:50 PM   #16
Digital Marketer
War Room Member
 
WillR's Avatar
 
Join Date: 2010
Location: Australia
Posts: 12,475
Thanks: 1,984
Thanked 8,187 Times in 4,079 Posts
Default
Re: Problems validating site in the W3C mobileOK Checker
Share on: 
fb share twitter share gplus share more share

Originally Posted by emergemma View Post

Okay, thanks. Yes, I checked it out in Internet Explorer and it still looks good. Just missing the rounded edges.
Yes, with regards to rounded edges, any browser that does not support CSS3 will just use straight edges instead. No big deal really. The things you need to be careful about are when using things such as CSS3 gradients for buttons etc. You need to make sure that if the gradient is not working the solid background color will still allow people to easily see the text on top of it.

In regards to testing, don't get too concerned about testing the sites on desktop browsers since most mobile phones use different browsers or different versions of those desktop browsers.

WillR is offline  
Closed Thread


Bookmarks

Tags
checker, mobileok, problems, site, validating, w3c


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 06:11 PM.