这是我在这里的第一篇文章,我希望有人能够帮助我.在过去的一周里,我一直在研究我的一个项目.显然,我坚持最后一部分.
基本上,我有一个AJAX聊天,当我提交一行时,我发送(使用Post方法)要分析的整行(到一个名为analysis.php的文件).
正在分析聊天行,并通过在MySql数据库上进行查询来查找我需要的变量.
我现在需要的是将这个变量与JQuery-AJAX一起使用并将其放在我的html文件中的div上(因此它可以显示在左右 - 任何聊天中).
这是我的文件:
analysis.php
<?php
$advert = $row[adverts];
?>
Run Code Online (Sandbox Code Playgroud)
Ajax的chat.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AJAX Chat</title>
<link rel="stylesheet" type="text/css" href="js/jScrollPane/jScrollPane.css" />
<link rel="stylesheet" type="text/css" href="css/page.css" />
<link rel="stylesheet" type="text/css" href="css/chat.css" />
</head>
<body>
<div id="chatContainer">
<div id="chatTopBar" class="rounded"></div>
<div id="chatLineHolder"></div>
<div id="chatUsers" class="rounded"></div>
<div id="chatBottomBar" class="rounded">
<div class="tip"></div>
<form id="loginForm" method="post" action="">
<input id="name" name="name" class="rounded" maxlength="16" />
<input id="email" name="email" class="rounded" />
<input type="submit" class="blueButton" value="Login" />
</form>
<form id="submitForm" …Run Code Online (Sandbox Code Playgroud) 我目前正在网站上做前端工作.我正在使用jquery来创建动态内容.
我的问题是当我输入我的URI(localhost/jquery/myfile /)并加载index.php时,我的jquery脚本可以工作,但是当我点击我的导航栏并将我的#index.php放在URI中时(localhost) /jquery/myfile/#index.php)我的一个js脚本,一个带有悬停效果的脚本,不起作用(但是我的所有其他js文件都可以工作,比如我的导航菜单脚本也包含一个悬停效果) .
我进行了研究,发现当加载新URI时,悬停效果停止工作.
的index.php
<section id="main-content">
<div id="guts">
<div id="items">
<a style="opacity: 1;" class="item" href="#" title="">
<img src="#" width="190" height="120">
<span style="display: none;" class="caption">8 Extremely </span></a>
<a style="opacity: 1;" class="item" href="#" title="">
<img src="#" width="190" height="120">
<span class="caption">8 Amazing Javascript Experiments of Physic and Gravity Simulation</span></a>
<a style="opacity: 1;" class="item" href="#" title="">
<img src="#" width="190" height="120">
<span class="caption">8 Incredible Wordpress Plugins</span></a>
<a style="opacity: 1;" class="item" href="#" title="">
<img src="#" width="190" height="120">
<span class="caption">9 Web CSS Tools You …Run Code Online (Sandbox Code Playgroud)