For some reason, the elements that are supposed to be loaded using this code into certain DIVs disappear when I call a refresh of the DIV explicitly. If I refresh the ENTIRE page the elements will return of course. What exactly am I doing wrong?
(function() {
$('div.heriyah').each(function() {
$(this).html('<? if (!isset($_SESSION[\'username2009\'])) {} else { echo \"<div class=\"add\"><div id=\"add_button_container\"><div id=\"add_button\" class=\"edit_links\"> + Add Element</div></div></div><div class=\"clear\"></div></div>\"; }?>');
var curID = $(this).attr('id');//get the id before you go into fallr
$('.add').click(function() {
$.fallr('show', {
content : '<iframe width="620" height="600" src="admin/add_content_select.php?pageID=<? echo $pageID; ?>&div='+ curID +'"></iframe>',
width : 320, // 100 = for width padding
height : 400,
closeKey : true,
closeOverlay : true,
buttons : {}
});
});
});
})();
You need to escape the quotes in
$_SESSION.You also have some more escaping issues with this part:
When this is evaluated, it will look like this:
This is not valid and to fix it, you need to add a backslash before each escaped quote.