jquery .html() not displaying in ie works fine in firefox

meeko

New Member
I have a what i would call a stange problem, though its to do with internet explorer (7 8 in both normal and compatability modes) so is not that strange to have a problem!!I have created a page break system.there are buttons on the page [previous] [next] [show all] / [show as pages]when the buttons are clicked it uses an ajax call to get the data and replace the html of a div.all the buttons work in firefox, safari etc but in ie only the [show all] [show as pages] buttons work the [previous] [next] buttons just empty the data.the page is visible here:http://www.pimms-transfer-eu.org/index_ietest.php?id_lang=10here is my jquery code:\[code\]$(document).ready(function() { $id_sec = <?php echo $row_rs_sections['id_sec']; ?>; function getBreaks($id_sec ,$id_brk){ // function to get next page and previous page var ajax_load = "<img src='http://stackoverflow.com/questions/3940652/img/icons/loadinfo_circle 16x16.gif' alt='loading...' /> Loading data..."; $("#pbcontent").html(ajax_load); $.get('getbreakData.php?id_sec='+$id_sec+'&id_brk='+$id_brk, function(data) { $("#pbcontent").empty(); // tried adding this to fix ie prob $("#pbcontent").html(data); }); }; function getAllBreaks($id_sec){ //function to get all pages var ajax_load = "<img src='http://stackoverflow.com/questions/3940652/img/icons/loadinfo_circle 16x16.gif' alt='loading...' /> Loading data..."; $("#pbcontent").html(ajax_load); $.get('getbreakData.php?id_sec='+$id_sec+'&showall=true', function(data) { $("#pbcontent").html(data); }); }; //using live as buttons are page loaded via ajax $('.showAllButton').live('click', function(){ $id_brk = $(this).attr('rel'); getAllBreaks($id_sec, $id_brk); }); $('.showAsPagesButton').live('click', function(){ $id_brk = $(this).attr('rel'); getBreaks($id_sec, 0); }); $('.prevButton').live('click', function(){ $id_brk = $(this).attr('rel'); getBreaks($id_sec, $id_brk); }); $('.prevButton').live('hover', function () { this.src = 'http://stackoverflow.com/img/icons/prev_on.gif'; }, function () { this.src = 'http://stackoverflow.com/img/icons/prev_off.gif'; }); $('.nextButton').live('click', function(){ $id_brk = $(this).attr('rel'); getBreaks($id_sec, $id_brk); }); $('.nextButton').live('hover', function () { this.src = 'http://stackoverflow.com/img/icons/next_on.gif'; }, function () { this.src = 'http://stackoverflow.com/img/icons/next_off.gif'; }); getBreaks($id_sec ,0); // load page});\[/code\]and the code that is called via ajax:\[code\] <?php require_once('Connections/pimms.php'); ?> <?php // Require the MXI classes require_once ('includes/mxi/MXI.php'); if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValuehttp://stackoverflow.com/questions/3940652/= "", $theNotDefinedValuehttp://stackoverflow.com/questions/3940652/= "") { $theValue = http://stackoverflow.com/questions/3940652/get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = http://stackoverflow.com/questions/3940652/($theValue !="") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = http://stackoverflow.com/questions/3940652/($theValue !="") ? intval($theValue) : "NULL"; break; case "double": $theValue = http://stackoverflow.com/questions/3940652/($theValue !="") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = http://stackoverflow.com/questions/3940652/($theValue !="") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = http://stackoverflow.com/questions/3940652/($theValue !="") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $MMID_rs_pagebreaks = "0"; if (isset($_GET['id_sec'])) { $MMID_rs_pagebreaks = $_GET['id_sec']; } mysql_select_db($database_pimms, $pimms); $query_rs_pagebreaks = sprintf("SELECT * FROM sections_sec WHERE id_sec = %s", GetSQLValueString($MMID_rs_pagebreaks, "int")); $rs_pagebreaks = mysql_query($query_rs_pagebreaks, $pimms) or die(mysql_error()); $row_rs_pagebreaks = mysql_fetch_assoc($rs_pagebreaks); $totalRows_rs_pagebreaks = mysql_num_rows($rs_pagebreaks); $id_sec = $row_rs_pagebreaks['id_sec']; ?> <?php // set up the vars //store the content for the page in $str $str = $row_rs_pagebreaks['text_sec']; // break up the content into pages $myPages = explode('<div style="page-break-after: always;">',$str); // get the number of pages $pageCount = count($myPages); // array starts from 0 so create values for the display counter +1 $pageCountHR = $pageCount; // set default to the first page ($page = 0) $page = 0; //set the default to the display counter $pageHR = $page+1; // set the page to the page requested if it has been passed if (isset($_GET['id_brk'])) { $page = $_GET['id_brk']; //set the value to the display counter $pageHR = ($page+1); }; // set up the next and previous links $nextLink = $page +1; $prevLink = $page -1; // echo the results /* echo('pagecount in array = '.$pageCount.'<br>'); echo('hr pagecount = '.$pageCountHR.'<br>'); echo('page in array = '.$page.'<br>'); echo('hr page = '.$pageHR.'<br>'); echo('prev page = '.$prevLink.'<br>'); echo('next page = '.$nextLink.'<br>'); */ // set wether to show all pages or not $showAll = false; if (isset($_GET['showall'])) { $showAll = $_GET['showall']; }; // set the page to display $pagetoprint = $myPages[$page]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="http://stackoverflow.com/questions/3940652/css/pagebreaks2.css" rel="stylesheet" type="text/css" /> <script src="http://stackoverflow.com/questions/3940652/Scripts/development-bundle/jquery-1.4.2.js" type="text/javascript"></script> <script src="http://stackoverflow.com/questions/3940652/Scripts/roundedcorners.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('.pagingInfo').corner(); $('.navButton_on').corner(); }); </script> </head> <body> <?php if($pageCount > 1){?> <div id="navBar"> <?php if ($page != 0){?> <div id="navitem"> <?php if($showAll == false){?> <img src="http://stackoverflow.com/img/icons/prev_off.gif" alt="To Left" width="21" height="15" class="prevButton" rel="<?php echo($prevLink);?>"/> <?php };?> </div> <?php }else{?> <div class="noButton"></div> <?php };?> <?php if($showAll == false){?> <div class="pagingInfo"> Page <?php echo($pageHR);?> of <?php echo($pageCountHR);?> </div> <?php };?> <?php if ($pageHR < $pageCountHR){ ?> <div id="navitem"> <?php if($showAll == false){?> <img src="http://stackoverflow.com/img/icons/next_off.gif" alt="To Right" name="NavRight" class="nextButton" id="NavRight" rel="<?php echo($nextLink); ?>"/> <?php };?> </div> <?php }else{ ?> <div class="noButton"></div> <?php }; ?> <?php if ($showAll == false){?> <div class="showAllButton navButton_on"> Show All Pages </div> <?php };?> <?php if ($showAll == true){?> <div class="showAsPagesButton navButton_on"> Show As Pages </div> <?php };?> </div> <br /> <br /> <?php };?> <h1><?php echo $row_rs_pagebreaks['name_sec']; ?></h1> <?php if ($showAll == true){ echo($str); }else{ echo($pagetoprint); };?> <?php if($pageCount >1){?> <div id="navBar"> <?php if ($page != 0){?> <div id="navitem"> <?php if($showAll == false){?> <img src="http://stackoverflow.com/img/icons/prev_off.gif" alt="To Left" width="21" height="15" class="prevButton" rel="<?php echo($prevLink);?>"/> <?php };?> </div> <?php }else{?> <div class="noButton"></div> <?php };?> <?php if($showAll == false){?> <div class="pagingInfo"> Page <?php echo($pageHR);?> of <?php echo($pageCountHR);?> </div> <?php };?> <?php if ($pageHR < $pageCountHR){ ?> <div id="navitem"> <?php if($showAll == false){?> <img src="http://stackoverflow.com/img/icons/next_off.gif" alt="To Right" name="NavRight" class="nextButton" id="NavRight" rel="<?php echo($nextLink); ?>"/> <?php };?> </div> <?php }else{ ?> <div class="noButton"></div> <?php }; ?> <?php if ($showAll == false){?> <div class="showAllButton navButton_on"> Show All Pages </div> <?php };?> <?php if ($showAll == true){?> <div class="showAsPagesButton navButton_on"> Show As Pages </div> <?php };?> </div> <br /> <br /> <?php };?> </body> </html><?php mysql_free_result($rs_pagebreaks);?>\[/code\]EDIT:i looked into document types in case that was the problemand i think i have it set up correctly on both files: getbreakdata.php:
\[code\]<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\[/code\]
index_ietest.php:
\[code\]<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\[/code\]
 
Back
Top