脚本宝典收集整理的这篇文章主要介绍了php – 未捕获的异常:jQuery UI选项卡:不匹配的片段标识符,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
jquery
page = { getChat: function() { $.ajax({ url: 'game_src.PHP',data: 'mode=getChat',dataType: 'html',cache: false,success: function(res){ $("#chatBox").html(res); } }); } }; $("#submitmsg").click(function(){ var clientmsg = $("#usermsg").val(); $.ajax({ url : 'game_src.PHP',data: 'mode=chatSubmit&msg=' + encodeURIComponent(clientmsg) }); $("#usermsg").attr("value",""); return false; }); setInterval(page.getChat,4000); $("#chatChannel").tabs({ cookie: { expires: 1 },});
聊天机构
<?PHP if($user->data['user_id'] == ANONYMOUS) { } else { ?> <div id="chatChannel"> <ul> <li><a href="#global">Global</a></li> <li><a href="#alli">Alliance</a></li> </ul> </div> <form name="message" action=""> <input name="usermsg" type="text" id="usermsg" size="25" /> <input name="submitmsg" type="submit" id="submitmsg" value="Send" /> </form> <br /> <?PHP } ?> <div id="chatBox" style="border:1px solid black;background-color: rgba(255,255,0.3);height:400px;overflow:auto;"> <div id="global"> <?PHP $chatMsgs = array(); $limit = time()-86400; $sql = 'SELECT COUNT(chat_id) as count FROM '.CHAT_TABLE.' WHERE chat_channel = 0 AND chat_time > '.$limit; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $count = $row['count']; if($count > 0) { $sql = 'SELECT * FROM '.CHAT_TABLE.' WHERE chat_channel = 0 AND chat_time > '.$limit.' ORDER BY chat_time DESC'; $result = $db->sql_query($sql); while($row = $db->sql_fetchrow($result)) { $chatMsgs[] = array( 'chat_time' => $row['chat_time'],'chat_msg' => $row['chat_msg'],'chat_user' => $row['chat_user'],'chat_channel' => $row['chat_channel'] ); } foreach($chatMsgs as $msg) { $sql = 'SELECT username FROM '.USERS_TABLE.' WHERE user_id = '.$msg['chat_user']; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $username = $row['username']; echo '<div class="chatMsg" style="border-bottom:1px solid black;">'; echo '<div class="chatUsr">'.$username.' says:</div>'; echo '<div class="chatUsrMsg" style="float:left;">'.$msg['chat_msg'].'</div>'; echo '<div class="chatMsgTime" style="float:right;">'.date("g:i a",$msg['chat_time']).'</div>'; echo '</div>'; echo '<br />'; echo '<hr />'; } } else { echo '<div class="chatMsg">Nothing is heard but the sound of crickets...</div>'; } ?> </div> <div id="alli"> <?PHP $chatMsgs = array(); $limit = time()-86400; $sql = 'SELECT COUNT(chat_id) as count FROM '.CHAT_TABLE.' WHERE chat_channel = 1 AND chat_time > '.$limit; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $count = $row['count']; if($count > 0) { $sql = 'SELECT * FROM '.CHAT_TABLE.' WHERE chat_channel = 1 AND chat_time > '.$limit.' ORDER BY chat_time DESC'; $result = $db->sql_query($sql); while($row = $db->sql_fetchrow($result)) { $chatMsgs[] = array( 'chat_time' => $row['chat_time'],$msg['chat_time']).'</div>'; echo '</div>'; echo '<br />'; echo '<hr />'; } } else { echo '<div class="chatMsg">Nothing is heard but the sound of crickets...</div>'; } ?> </div> </div>
以上是脚本宝典为你收集整理的php – 未捕获的异常:jQuery UI选项卡:不匹配的片段标识符全部内容,希望文章能够帮你解决php – 未捕获的异常:jQuery UI选项卡:不匹配的片段标识符所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。