Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/429.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.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
Javascript 未捕获的语法错误:意外标记<;-Wordpress_Javascript_Php_Jquery_Wordpress_Wordpress Theming - Fatal编程技术网

Javascript 未捕获的语法错误:意外标记<;-Wordpress

Javascript 未捕获的语法错误:意外标记<;-Wordpress,javascript,php,jquery,wordpress,wordpress-theming,Javascript,Php,Jquery,Wordpress,Wordpress Theming,我正在使用拍卖主题,收到以下错误消息: Uncaught SyntaxError: Unexpected token < penny_scripts.js:126 penny_scripts.js的第126行是 var myObj = eval("(" + data + ")"); for (var i = 0; i < myObj.length; i++) <---This line { pid = myObj[i].pid;

我正在使用拍卖主题,收到以下错误消息:

Uncaught SyntaxError: Unexpected token <     penny_scripts.js:126
penny_scripts.js的第126行是

var myObj = eval("(" + data + ")");
for (var i = 0; i < myObj.length; i++) <---This line
{
    pid                 = myObj[i].pid;
    rnd                 = myObj[i].rnd;
    remaining_time      = myObj[i].remaining_time;
    current_bid         = myObj[i].current_bid;
smart update.js
的第146行是:

$info = array(); global $wpdb;
$my_arr = $_POST['my_values'];
$OKOK = $_POST['OKOK'];

foreach($my_arr as $id_plus_rand)
{
$exp = explode("_",$id_plus_rand);
$pid = $exp[0];
$rnd = $exp[1];

//----------------------
$newpid = array();  

$highest_bidder_id  = PennyTheme_get_highest_bid_owner_obj($pid);

if($highest_bidder_id == false) $highest_bidder = "0";
else {

    $s = "select user_login from ".$wpdb->users." where ID='{$highest_bidder_id->uid}'";
    $r = $wpdb->get_results($s); $r = $r[0];
    $highest_bidder =   $r->user_login;

}       

$newpid['highest_bidder'] = $highest_bidder;    
$newpid['highest_bidder_id'] = $highest_bidder_id->id;      
$newpid['pid'] = $pid;
$newpid['rnd'] = $rnd;
$newpid['remaining_time'] = get_post_meta($pid, 'ending', true) - current_time('timestamp',0);
$newpid['current_bid'] = PennyTheme_get_show_price(get_post_meta($pid, 'current_bid', true));


if($OKOK == "1"):

//$closed = get_post_meta($pid, 'closed', true);
//$post = get_post($pid);               

$bids = "select * from ".$wpdb->prefix."penny_bids where pid='$pid' order by id DESC limit 13";
$res  = $wpdb->get_results($bids);

$all_bids = '';

if(count($res) > 0)
{
    $all_bids .= '<table width="100%">';
    $all_bids .= '<thead><tr>';
    $all_bids .= '<th>'.__('Username','PennyTheme').'</th>';
    $all_bids .= '<th>'.__('Bid Amount','PennyTheme').'</th>';
    //      echo '<th>'.__('Date Made','PennyTheme').'</th>';

    $all_bids .= '</tr></thead><tbody>';
    //-------------

    foreach($res as $row)
    {
        $user = get_userdata($row->uid);
        $s = "select user_login from ".$wpdb->users." where ID='{$row->uid}'";
        $r = $wpdb->get_results($s);

        $all_bids .= '<tr>';
        $all_bids .= '<th>'.$r[0]->user_login.'</th>';
        $all_bids .= '<th>'.PennyTheme_get_show_price($row->bid).'</th>';
        //  echo '<th>'.date("d-M-Y H:i:s", $row->date_made).'</th>';

        $all_bids .= '</tr>';

    }

    $all_bids .= '</tbody></table>';
}
else $all_bids .= __("No bids placed yet.", 'PennyTheme');

$newpid['bidders'] = $all_bids;
endif;

array_push($info,$newpid); 

}
header('Content-type: application/json');   <---Line 1092
if(es.rCallback && rCallback && es.rCallback.search(rCallback) != -1) {
window[rCallback](data);
} else  { 
es.callback(data);  <---This line
}
仅当我未登录站点或使用用户级别低于
参与者的帐户登录时,才会收到此错误消息


我不知道为什么会发生这种情况,也不知道如何解决。非常感谢您的帮助。

上述问题是由我在网站上启用的一个。当我更新它时,错误停止了。版本
2.19.5
或更高版本不会发生此错误。2.19.5的更改日志


  • 删除作者的推荐菜单删除代码错误出现在
    wp admin/includes/plugin.PHP
    的第1395行的PHP-
    foreach
    循环中。PHP
尝试迭代不同于数组的内容。错误消息阻止发送更多标题。此外,生成HTML时需要JSON。JS报告的错误只是PHP问题的结果。您的WP插件有问题。我已经添加了
plugin.php
文件第1395行中的内容。显示第1395行之前的内容1092@brasofilo你是。另一个是使用
管理菜单
,我使用的是它的旧版本。当我更新插件时,错误停止了。我不止一次看到通知和警告被丢弃,因为。。。这是溢出到你的JS然后。。。
if(es.rCallback && rCallback && es.rCallback.search(rCallback) != -1) {
window[rCallback](data);
} else  { 
es.callback(data);  <---This line
}
function remove_menu_page( $menu_slug ) {
global $menu;

foreach ( $menu as $i => $item ) {  <-- This line
    if ( $menu_slug == $item[2] ) {
        unset( $menu[$i] );
        return $item;
    }
}

return false;
 }