0
我有这样的代码。firefox语法错误
在line.php文件: 简单speeking,我只输出字符串时查询此页:
<?php
print("love you")
?>
然后在b.php,我使用的模板代码波纹管(PHP模板),我有这样的代码 我将调用draw_line_chart函数,该函数将查询line.php以获取输出。
function get_char(product,project){
var lineUrl = 'line.php';
send_http_request(lineUrl,_plot_line);
function _plot_line(request){
;//plot_line(request,product,project) //function to get the line code .
}
}
function send_http_request(url,call_function){
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :(Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange=function(){
if(http_request.readyState == 4){
call_function(http_request);
}
}
http_request.open('GET',url,false);
http_request.send(null);
return http_request;
}
OK,当它在谷歌浏览器使用,它是正确的,但在Firefox的时候。它走错了。而在错误控制台,它说syntax error "love you"
其中是'plot_line'函数/ firefox说错误驻留在哪里?它应该给你一个文件+行参考 – Quamis 2011-05-11 10:33:54
它不关心什么plot_line做,如果我想念它,仍然是错的。 – mike 2011-05-11 12:17:49
另外,值得一提的是,像jQuery或mootools这样的库可以包含这种类型的内容......都包含健壮且易于使用的AJAX请求。 – eykanal 2011-05-11 12:23:25