0

I am working on html5 offline mode in sales-force. I added following line to cache current page.

<html manifest="{!$Page.offlineCache}"> 

I turn off the developer mode and check the console. It is by default taking parent tag as follow:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<!DOCTYPE html>

<html manifest="/apex/offlineCache">

<head> 

As parent tag is not taking manifest attribute, Current page is not getting cached.

How can I remove that auto appended <html> parent tag?

Apex page code :

<apex:page standardStylesheets="false" cache="true"  showHeader="false" sidebar="false" controller="offlineCon"  title="Offline Page" docType="html-5.0">
<html manifest="/apex/offlineCache">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Offline page</title>
    <apex:includeScript value="{!$Resource.all}"/>
</head>

<body>
    <label >Contact First Name</label>
    <input type="text" id="FirstName"></input>
    <button id="savebtn">Save</button><br/><br/>
    <label>Contact Last Name </label>
    <input type="text" id="LastName"></input>
    <button id="test">test</button> 
    <ol id="state"></ol>
</body> 
</html> 
</apex:page>
Archana
  • 101
  • 2
  • 9

2 Answers2

2

In the apex:page tag, add applyHtmlTag="false". Reverting back to a very old API version is not a very good idea!

You should have something like this:

<apex:page docType="html-5.0" showHeader="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false"  controller="AppController">
likeitlikeit
  • 5,317
  • 4
  • 33
  • 53
Marc B
  • 21
  • 1
0

try by setting the docType attribute on apex:page

sample:

<apex:page sidebar="false" showHeader="false" standardStylesheets="false"  docType="html-5.0" >
 <html manifest="/apex/offlineCache">
   <head>
      <style> body{color : red;}</style>
   </head>
   <body>
      <h1>Congratulations</h1>
      This is your new Page: :)
   </body>
 </html>
</apex:page>
Martin Borthiry
  • 5,078
  • 9
  • 36
  • 58
  • First doctype statment is removed. That is : But parent tag is still showing up. – Archana May 14 '13 at 04:39
  • 1
    Thanks Martin for your help. But the actual problem was with version setting. I was using version 27.0. I changed it to 20.0 and it worked. – Archana May 16 '13 at 05:23