By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,939 Members | 1,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,939 IT Pros & Developers. It's quick & easy.

JQuery 1.8.3 body.append() not working in IE 6.0 and above

P: 1
I have used jquery-1.8.3.js package for appending a table to body. It works good in Mozilla Firefox and Google Chrome >> But Not in IE 6.0 and above >> API used is body.append({table content}). Following is my jquery script which gets executed on window scroll. Please put some light on this


Expand|Select|Wrap|Line Numbers
  1. $(window).scroll(function () {
  2.  
  3.         var yOffset = window.pageYOffset;
  4.         var appendVal;
  5.  
  6.         if(yOffset == "undefined") {
  7.             yOffset = 270;
  8.         }       
  9.  
  10.         if(yOffset >= 270) {
  11.             disFlag = "No Scroll";
  12.         } else {
  13.             disFlag = "Scroll"; 
  14.         }
  15.  
  16.         if(disFlag == "Scroll") {   
  17.  
  18.             appendVal = '<div id="toTop" style = "width:1000px; height:70px; float:left; color:#000000; font-weight:bold; font-family:Arial; font-size:12px; background-color: #b3b3b3; margin:0px 85px 0px 0px;"><form name = "frmPopUpSearch" action = "http://bytes.com/"  method = "post" onsubmit="return popupValidate();" ><table cellpadding="0" cellspacing="0" border="0" width="995px" style = "text-align:left !important; vertical-align:top;"><tbody><tr><td><table><tr><td width = "15px"></td><td height = "30px" style = "vertical-align:middle; padding:10px 0px 0px 0px;">Category*:*</td><td width = "160px" style = "padding:10px 0px 0px 0px;"><input type = "text" name = "searchBycat" id = "popupCats" autocomplete="off" style = "height:26px; width:150px; font-family: Arial; font-size:12px; color:#656565; border:1px solid #656565; font-weight:bold; margin:0px 0px 0px 0px;" value = "e.g. Cars, Mobile Phone" onmouseout="return setpopupCatValue();" onclick="this.value=\'\';" onkeyup = "return fillPopUpCats();" onchange = "return check_popupCatSearch();" /></td></tr><tr><td colspan = "3" style = "text-align:center;" ><div style = "margin:0px 0px 0px 0px;" id =  "popup_search_cat_result">*</div></td></tr></table></td><td width = "10px"></td><td><table><tr><td width = "30px" style = "vertical-align:middle; text-align:right; padding:10px 0px 0px 0px;">Location*:*</td><td width = "160px" style = "padding:0px 0px 0px 0px;">*<input type = "text" name = "searchByarea" id = "popupAreas" autocomplete="off"  style = "height:25px; width:150px; font-family:Arial; font-size:12px; color:#656565; border:1px solid #656565; font-weight:bold; margin:0px 0px 0px 0px;"  value = "e.g. suburb or postcode" onclick="this.value=\'\';"  onmouseout="return setpopupLocValue();" onkeyup = "return fillPopUpAreas();" onchange = "return check_popupAreaSearch();"/></td></tr><tr><td colspan = "3" style = "text-align:center; vertical-align:top !important;"><div id = "popup_search_area_result">*</div></td></tr></table></td><td width = "10px"></td><td width = "150px" style = "padding:16px 0px 5px 0px; vertical-align:top;" ><input type = "submit" value = "Search" id = "searchButton" style = "background-color:#4F9B1C; width:128px; height:30px; color:#ffffff; font-family:Arial; font-size:12px; font-weight:bold; border:0px; " /></td><td width = "240px" style = "padding:25px 0px 5px 0px; vertical-align:top;"><a href = "http://bytes.com/" style = "text-decoration:none; color:#666666 !important;">Make DirectoryXperia my homepage</a></td><td width = "200px"></td></tr></table></tbody></table><input type = "hidden" name = "pageLoad" value = "p" /></form></div>'; // background-image:url(images/template/search.jpg); background-repeat:no-repeat; 
  19.  
  20.         } else {
  21.  
  22.             appendVal = '';
  23.         }
  24.  
  25.         jQuery(document.body).append(appendVal); //appendVal 
  26.  
  27.         if($(this).scrollTop() != 0 && disFlag == "No Scroll") {
  28.             $('#toTop').fadeIn();
  29.         } else {
  30.             $('#toTop').fadeOut();
  31.         }
  32.  
  33.     });
Mar 21 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.