views:

47

answers:

1

This is a strange one that I cannot see to figure out. I have a basic mobile site that is coded in ASP.NET MVC (really shouldn't matter in this case but just to put it out there)

When I browse to the specific page, I receive the following error.

This page contains the following errors:

error on line 56 at column 43: EntityRef: expecting ';'

Below is a rendering of the page up to the first error

Now the line specifically is rendering a basic anchor tag does have an ampersand in the query string (should be pretty standard right?). Why might this be an issue?

The IPhone does not have any problem rendering it, nor do regular browsers (IE8, Chrome, FF, etc). By my the Palm Pre Browser, Android, and BlackBerry Bold all display it.

Specifically, below appears to be the offending line (part of a basic paging control):

    <a href="/Mobile/LotBrowse?page=2&watchList=False" style="text-decoration: none" title="go to page 2"> 
    <span class="page-numbers"> 
        2</span></a>
A: 

You need to use &amp; for all & in your XHTML code. Any where and every where it is used http://www.w3.org/TR/xml-entity-names/ http://www.digitalmediaminute.com/reference/entity/index.php

drubin
Thanks for the reponse. Why exactly is this though? I mean like I say it renders fine in all full browsers, but on a couple of phones it doesn't like it. Why would their browers be any different for this case? Is there anyway I can get around this by declaring a different doc type or something?
aherrick
Because there browser more strict than others. Normaly, mobile browser are more strict.
fravelgue
Because it is the spec. Xhtml :) just because some browsers don't follow it doesn't mean they all wont. hehe
drubin