Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php prototype 1.7不适用于Chrome和IE_Php_Internet Explorer_Google Chrome_Prototypejs_Prototype - Fatal编程技术网

Php prototype 1.7不适用于Chrome和IE

Php prototype 1.7不适用于Chrome和IE,php,internet-explorer,google-chrome,prototypejs,prototype,Php,Internet Explorer,Google Chrome,Prototypejs,Prototype,我正在尝试使用原型脚本构建一个带有交互界面的登录页,但我发现chrome和IE中存在一些问题,FireFox做得很好,我不知道为什么 以下是index.php的代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//AR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999

我正在尝试使用原型脚本构建一个带有交互界面的登录页,但我发现chrome和IE中存在一些问题,FireFox做得很好,我不知道为什么

以下是index.php的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//AR" "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=ISO-8859-1" />
<title>Take Surveys and Get Cash</title>
<script type='text/javascript' src="prototype-1.7.1.js"></script>
<script type='text/javascript'>
function refresh()
{
   var opt = {
                method: 'get', 
                parameters: '',
             };
   var url = 'page2.php';
   var laRequete = new Ajax.Updater('conteneur', url, opt);
}
</script>
<style type="text/css">
<!--
#conteneur {
    background-color:White;
    margin:auto;
    width:800px;
}
.Style1 {
    color: YELLOW;
    font-weight: bold;
    font-size: 36px;
}
.Style3 {
    color: WHITE;
    font-weight: bold;
    font-size: 36px;
}
#body {
    background-color:White;
}
#maj{
    cursor:pointer;
}
.Style2 {font-size: larger}
-->
</style>

</head>

<body>

<div id="conteneur">
    <table BORDER="0">
        <tr>
            <td COLSPAN="2"><img src="survey.png" /></td>
        </tr>
        <tr>
            <td><span id='maj' onclick="refresh();"><img src="Yes.png" /></span></td>
            <td><span id='maj' onclick="refresh();"><img src="No.png" /></span></td>
        </tr>
    </table>

<div id="statcounter_image" style="display:inline;"><a
title="hits counter" href="http://statcounter.com/"
class="statcounter"><img
src="http://c.statcounter.com/9318376/0/c82ce179/1/"
alt="hits counter" style="border:none;" /></a></div>
</div>
</body>
</html>

接受调查并获得现金
函数刷新()
{
变量opt={
方法:“get”,
参数:“”,
};
var url='page2.php';
var laRequete=new Ajax.Updater('conteneur',url,opt);
}
下面是page2.php中的代码:

<table BORDER="0">
    <tr>
        <td COLSPAN="2"><img src="Age.png" /></td>
    </tr>
    <tr>
        <td><span id='maj' onclick="refresh();"><img src="Yes.png" /></span></td>
        <td><span id='maj' onclick="refresh();"><img src="No.png" /></span></td>
    </tr>
</table>

您的脚本存在一些问题,可能会妨碍它正常工作

  • 您在两个不同的元素(
    maj
    )上注册了相同的id,id对于页面应该是唯一的

  • 如果您使用的是onclick属性而不是事件观察者,请尝试使用类似于
    $('maj')的观察者。观察('click',refresh)

  • 更新至2014年4月发布的PrototypeJS(1.7.2)的最新版本,在最新版本中修复了许多bug和更新