The div divAutoTeller is given a negative margin on the left, it pulls the element in left direction. Please try to adjust the
margin-left value or remove it for a test and check if the ol li elements appears.
Please let me know how it works, thanks.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
is given a negative margin on the left, it pulls the element in left direction. Please try to adjust the
margin-left value or remove it for a test and check if the ol li elements appears.
Thx
But it's still working well when in Compatable mode……why not in a normal mode?!
base on my research, in normal mode, the negative margin left property of divAutoTeller made the elements in it move to too left so that we can not see them(Inoderto
prove this, you can change bigger for margin-left value, e.g. margin-left: -50px, then you can see part of the OL content ). I just thought, the function append works and since your moving div divAutoTeller left outside of the wrapper will
not see it.
as why it is working in compatibility mode, Could you help to send me the page rendered source(right click on your webpage, choose 'View source', copy the orgional source and paste here) for us to check, and please tell me which version of IE you are using.
thanks.
best regards,
Please mark the replies as answers if they help or unmark if not.
Feedback to us
ToughMan
Participant
1490 Points
635 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 03, 2013 03:59 AM|LINK
Hi CruzerB,
But this works well if I use Compatable mode?????
CruzerB
Contributor
5399 Points
1098 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 03, 2013 11:38 PM|LINK
It should works.
My Technical Blog
ToughMan
Participant
1490 Points
635 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 12:47 AM|LINK
In fact it's NOT.
CruzerB
Contributor
5399 Points
1098 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 01:42 AM|LINK
Can you get the html output and show us here?
My Technical Blog
ToughMan
Participant
1490 Points
635 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 01:48 AM|LINK
<!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" /> <link href="CSS/Default.css" rel="stylesheet" /> <title>My Disc</title> <script type="text/javascript" src="Scripts/jquery-1.9.0.js"></script> <script type="text/javascript"> $(function () { $('#txtWordSearch').keyup(function () { if ($(this).val().trim() == "") { $('#divAutoTeller').hide(); } else { $('#divAutoTeller').show(); $('#divAutoTeller').empty(); $('#divAutoTeller').append("<table width='100%'>"); $.get("/InnerSearch.aspx?word=" + encodeURI($('#txtWordSearch').val())).success(function (text) { //Put an alert in "each", it works well!, but it just cannot show a whole table??? $(text).find("EnglishName").each(function () { $('#divAutoTeller').append('<tr>'); $('#divAutoTeller').append('<td>yy</td>'); $('#divAutoTeller').append('</tr>'); }); } ).error(function () { alert("Fail to read the intellsense"); }); $('#divAutoTeller').append('</table>'); } }); }); </script> </head> <body> <form name="form1" method="post" action="Default.aspx" id="form1"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMzgzNDk0ODIyZGSpFa3S+kexSRc+a6PJspVluXXo9w==" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwLi9rjPAgL6+7OXCwKln/PuClw2o6TB/e1EcWR+ITdxs9bVHs/S" /> </div> <div class="DivContentsAllCenter"> <a href="##"> <div id="search_box" style="margin-top: 30px;"> <input name="txtWordSearch" type="text" maxlength="20" id="txtWordSearch" style="width:426px;" /> <input type="submit" name="btnSearch" value="Find" id="btnSearch" style="width:84px;" /> <div id="divAutoTeller" style="margin-left:-500px;"> </div> </div> <div> </div> </div> </form> </body> </html>Yanping Wang...
Star
14871 Points
1529 Posts
Microsoft
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 02:16 AM|LINK
Hi ToughMan,
The div divAutoTeller is given a negative margin on the left, it pulls the element in left direction. Please try to adjust the margin-left value or remove it for a test and check if the ol li elements appears.
Please let me know how it works, thanks.
Feedback to us
Develop and promote your apps in Windows Store
CruzerB
Contributor
5399 Points
1098 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 02:49 AM|LINK
How about the output on the browser? Can you right click on the page and select "View Page Source" menu. Show us what being generated.
My Technical Blog
ToughMan
Participant
1490 Points
635 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 11:17 AM|LINK
Plz see the above codes
ToughMan
Participant
1490 Points
635 Posts
Re: Why doesn't jQuery's Append method work for div?
Feb 04, 2013 11:18 AM|LINK
Thx
But it's still working well when in Compatable mode……why not in a normal mode?!
Yanping Wang...
Star
14871 Points
1529 Posts
Microsoft
Re: Why doesn't jQuery's Append method work for div?
Feb 05, 2013 04:53 AM|LINK
Hi ToughMan,
Thanks for your reply.
base on my research, in normal mode, the negative margin left property of divAutoTeller made the elements in it move to too left so that we can not see them(In oder to prove this, you can change bigger for margin-left value, e.g. margin-left: -50px, then you can see part of the OL content ). I just thought, the function append works and since your moving div divAutoTeller left outside of the wrapper will not see it.
as why it is working in compatibility mode, Could you help to send me the page rendered source(right click on your webpage, choose 'View source', copy the orgional source and paste here) for us to check, and please tell me which version of IE you are using. thanks.
best regards,
Feedback to us
Develop and promote your apps in Windows Store