I am opening a page inside a shadowbox. But then when user clicks on a button, it loads the second div in the same page from a different page using jQuery.ajax. It works for FF,chrome and safari but not for IE8.
`function open_shadowbox_div_view(){
Shadowbox.open({
content:
$("#div1").html(),
player: "html",
height: 420,
width: 750 ,
options:{
onFinish: function(){
} ,
onClose: function(){ }
}
});
}
function newOccFunction(contract){
var site_url = "page.php?var=";?>"+var;
jQuery("#div1").load(site_url,function(){open_shadowbox_div_view();});
}'
this opens the first div.
Then there is a button in that page that loads up a div in the same page.php
Button onclick function
‘function filter(){
var site_url = "page2.php";
jQuery.ajax({
type: "POST",
url : site_url,
success: function(data){
alert(data);
jQuery("#sb-player #div2").html(data);
alert(jQuery("#sb-player #div2").html());//This returns null
},
failure: function(){
alert("fail");
}
});
}'
Any help will be appreciated.
Than you
since the content i am trying to load into a div is inside the first page in shadowbox, we don’t have to use #sb-player but all the div tag that is nested. It only affect in IE, therefore you can just do.
To clarify,
if it is like
then you can load content in “second_box” by doing this:
Hope it helps for those who have wasted hours figuring this.