how to change php functions send result to jquery ajax
- by OpenCode
I have many codes for user notifications, it do many mysql works, so it needs waiting times.
jquery ajax works for php files.
how can i use jquery for send php result to web page?
current code :
<? echo db_cache("main_top_naver_cache", 300, "naver_popular('naver_popular', 4)"))?>
wanted code : but it shows errors...
<div id='a'>
<div id='b'>
<script type="text/javascript">
$("#test1").html( " <? echo htmlspecialchars(db_cache("main_top_naver_cache", 300, "naver_popular('naver_popular', 4)"))?> " );
</script>
IE debuger shows error ... SCRIPT1015:...
<script type="text/javascript">
$("#test1").html( " <style>
/* http://html.nhncorp.com/uio_factory/ui_pattern/list/3 */
.section_ol3{position:relative;border:1px solid #ddd;background:#fff;font-size:12px;font-family:Tahoma, Geneva, sans-serif;line-height:normal;*zoom:1}
.section_ol3 a{color:#666;text-decoration:none}
.section_ol3 a:hover,
.section_ol3 a:active,
.section_ol3 a:focus{text-decoration:underline}
.section_ol3 em{font-style:normal}
.section_ol3 h2{margin:0;padding:10px 0 8px 13px;border-bottom:1px solid #ddd;font-size:12px;color:#333}
.section_ol3 h2 em{color:#cf3292}
.section_ol3 ol{margin:13px;padding:0;list-style:none}
.section_ol3 li{position:relative;margin:0 0 10px 0;*zoom:1}
.section_ol3 li:after{display:block;clear:both;content:""}
.section_ol3 li .ranking{display:inline-block;width:14px;height:11px;margin:0 5px 0 0;border-top:1px solid #fff;border-bottom:1px solid #d1d1d1;background:#d1d1d1;text-align:center;vertical-align:top;font:bold 10px Tahoma;color:#fff}
.section_ol3 li.best .ranking{border-bottom:1px solid #6e87a5;background:#6e87a5}
.section_ol3 li.best a{color:#7189a7}
.section_ol3 li .num{position:absolute;top:0;right:0;font-size:11px;color:#a8a8a8;white-space:nowrap}
.section_ol3 li.best .num{font-weight:bold;color:#7189a7}
.section_ol3 .more{position:absolute;top:10px;right:13px;font:11px Dotum, ??;text-decoration:none !important}
.section_ol3 .more span{margin:0 2px 0 0;font-weight:bold;font-size:16px;color:#d76ea9;vertical-align:middle}
</style>
<div class="section_ol3">
<ol style='text-align:left;'>
<li class='best'><span class='ranking'>1</span><a href='http://search.naver.com/search.naver?where=nexearch&query=%B9%AB%C7%D1%B5%B5%C0%FC&sm=top_lve' onfocus='this.blur()' title='????' target=new>????</a><span class='num'>+42</span></li><li class='best'><span class='ranking'>2</span><a href='http://search.naver.com/search.naver?where=nexearch&query=%B1%E8%C0%E7%BF%AC&sm=top_lve' onfocus='this.blur()' title='???' target=new>???</a><span class='num'>+123</span></li><li class='best'><span class='ranking'>3</span><a href='http://search.naver.com/search.naver?where=nexearch&query=%C0%CC%C7%CF%C0%CC&sm=top_lve' onfocus='this.blur()' title='???' target=new>???</a><span class='num'>+90</span></li><li ><span class='ranking'>4</span><a href='http://search.naver.com/search.naver?where=nexearch&query=%BA%D2%C8%C4%C0%C7%B8%ED%B0%EE2&sm=top_lve' onfocus='this.blur()' title='?????2' target=new>?????2</a><span class='num'>+87</span></li> </ol>
</div> " );