had
14 Aug 2008, 7:18 AM
Hello,
The piece of code that had to be added doesn't validate with the w3c since iframe isn't xhtml strict. It was quite bothersome because since adding history I always had errors with the html validator plugin for firefox, and it makes it more difficult to debug your page. I circumvented the error by adding the following code in Ext.History.init()
var form = document.createElement("form");
form.setAttribute("id", "history-form");
form.setAttribute("class", "x-hidden");
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("id", "x-history-field");
form.appendChild(input);
var iframe = document.createElement("iframe");
iframe.setAttribute("id", "x-history-frame");
form.appendChild(iframe);
document.documentElement.firstChild.appendChild(form);
It works and no need to add the iframe to the html any more for history to work. The one call to Ext.History.init() sets everything up which is even cooler... B)
The piece of code that had to be added doesn't validate with the w3c since iframe isn't xhtml strict. It was quite bothersome because since adding history I always had errors with the html validator plugin for firefox, and it makes it more difficult to debug your page. I circumvented the error by adding the following code in Ext.History.init()
var form = document.createElement("form");
form.setAttribute("id", "history-form");
form.setAttribute("class", "x-hidden");
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("id", "x-history-field");
form.appendChild(input);
var iframe = document.createElement("iframe");
iframe.setAttribute("id", "x-history-frame");
form.appendChild(iframe);
document.documentElement.firstChild.appendChild(form);
It works and no need to add the iframe to the html any more for history to work. The one call to Ext.History.init() sets everything up which is even cooler... B)