+ Start a Discussion
patrospatros 

HTML Strangeness

I have some questions/issues with how Visualforce renders the final HTML to the browser. My apologies if any of these have already been discussed. Please let me know if any of these are my problem or a bug. Here goes:

  1. I get duplicate DOCTYPE definitions when I use apex:include. It appears that the included page renders a new DOCTYPE reference at its position in the page.
  2. The <body> tag is not supplied when sidebar="false" and showHeader="false" in the apex:page attributes.
  3. I understand the purpose behind rendering <span> tags for all components, but it would be really nice to optionally restrict this. The added tags throw off the DOM and make things generally ugly. For example, if I want to inject a jQuery control (or the like), there's a risk that the control won't work due to the added tags, and I have no control over their display.
Ron HessRon Hess

try using apex:component rather than include

 

you can add a body tag in that case

 

check out the attribute layout= on many of the components, i think you can get a div insead of a span using the layout attribute.

danielbaladanielbala

this is my issue: I would like to have header and footer includes, I am using two components for these. the header has the opening html tag and the footer component has the closing tag.

 

Below is what gets rendered. I feel like I am sooo close, if I can remove the first doctype and html head span reference, I am ready to go. PLEASE help.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head></head><span id="Home:j_id0">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE" />
<meta HTTP-EQUIV="Expires" content="Mon, 01 Jan 1990 12:00:00 GMT" />
 </body>
</html>
</span></html>
Message Edited by danielbala on 08-05-2009 03:00 AM
danielbaladanielbala

hey man... I got a solution somewhere else, wanted to share...

 

 1) Doctype: try the options in this thread: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=3534