dialog content not loading on one page
Symptoms This applies to a Wordpress blog where there is a link that is used to activate a dialog containing a form. The link and the dialog are available on any page on the site. They are activated by a cookie that is set for site reviewers.
- Condition 1 - First time you visit th开发者_运维百科e HOME page the content will not load in the dialog
- Condition 2 - On the first visit go to any other of the main pages other than the home page and the dialog content will load as expected.
- Condition 3 - On the first visit go to any of the main pages other than the home page and then return to the home page. The content will load into the dialog as expected.
- Condition 4 - Go first to the home page and then reload the page. The content will NOT load.
Question: I'm looking for ideas on possible sources of the problem.
Its clear from looking at firebug that the .load function is not loading the content to the page, see below. However, I'm not knowledgeable enough at using firebug to detect what might be causing the problem. Note also that this is not a cookie problem. The cookie reveals the link for the dialog and that part is working perfectly.
Script that loads the content
jQuery(document).ready(function ($) {
$('#testform a').each(function(){
//set up variables
var cancel = function() {
$dialog.dialog('close');
};
//identify link to feedback form
$link=$(this);
//dialog variables
$dialog=$('<div id="form1container"></div>')
.load($link.attr('href') + ' #form_container' ,function(){
var testformoptions = {
target : "#output1",
url: 'http://www.business-navigation.com/value/review/form1_processing.php',
clearForm: 'true'
};
var form2options = {
target : "#output2",
url: 'http://www.business-navigation.com/value/review/form2_processing.php',
clearForm: 'true'
};
var form3options = {
target : '#output3',
url: 'http://www.business-navigation.com/value/review/form3_processing.php',
clearForm: 'true'
};
jQuery('#myform').ajaxForm(testformoptions);//prepare form
jQuery('#error_in_text').ajaxForm(form2options);//prepare form2
$('#confusing_layout').ajaxForm(form3options);// Prepare form 3
return false;
})
.dialog({
autoOpen: false,
buttons: { "Close": cancel, "Cancel": cancel},
title: $link.attr('title'),
width: 600
});
$link.click( function (){
$('div#output1, div#output2, div#output3').empty();
});
$link.click( function(){
$dialog.dialog('open');
$( "#accordion" ).accordion({
collapsible: true,
active: false,
fillSpace: true,
clearStyle: true
});
return false;
});
});
});
Any ideas or thoughts on the possible source of the problem would be much appreciated.
Thanks.
if you use Firefox (you mentioned firebug) you probably reload page using F5. try use ctrl + F5 and check if it's OK.
精彩评论