主要问题是 square-space 使用 java-script (YUI) 构建它们的表单。他们已经准备好将代码加载到文档上。我怎样才能等到他们的表格加载?这只是IE中的一个问题。
我的代码:(首先执行)
$(document).ready(function() {
$('#formFieldEl6').each(function(){
var collection = $.deparam.querystring(window.location);
$(this).val(collection.id);
$(this).attr("disabled", true);
});
});
Squarespace 代码:(最后执行)
var theForm10248992;
YAHOO.util.Event.onDOMReady(function() {
theForm10248992 = new Squarespace.FormBuilder( "theForm10248992", "formOuterContainer10248992", "formFields10248992", "formAddFieldControl10248992", "formErrorMessage10248992", "formSubmitButton10248992", 10248992, true , false , false , "Thanks for responding!" );
theForm10248992.initializeField( 6, "normal", "Title1", "", true, "", "", 1504386 );
theForm10248992.initializeField( 9, "normal", "Title2", "", true, "", "", 1504463 );
theForm10248992.initializeField( 4, "medium", "Title3", "", true, "", "", 1504387 );
theForm10248992.initializeField( 1, "medium", "Title4", "", true, "", "", 1504395 );
theForm10248992.initializeField( 2, "large", "Title5", "", true, "", "", 1504390 );
theForm10248992.initializeField( 1, "small", "Title6", "", true, "", "", 1599975 );
if (Squarespace.Orderable) { Squarespace.Orderable.ItemManager.initialize(); }
});
该代码只是从 URL 中填充一个值并禁用该控件。这适用于 FF 和 Chrome。在 IE 中使用开发人员工具进行调试时,我可以手动等待断点,直到表单加载然后代码工作,但我仍然无法让它在正常设置下工作。有任何想法吗?