ai didi

javascript - 未捕获的语法错误 : Unexpected token < - Wordpress

转载 作者:可可西里 更新时间:2023-10-31 23:48:02 24 4
gpt4 key购买 nike

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

Uncaught SyntaxError: Unexpected token <     penny_scripts.js:126

当我扩展它显示的错误时:

(anonymous function)   penny_scripts.js:126
$.ajax.success smart-updater.js:146
j jquery.js?ver=1.11.0:2
k.fireWith jquery.js?ver=1.11.0:2
x jquery.js?ver=1.11.0:4
b jquery.js?ver=1.11.0:4

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;

如果我执行 alert(data); 然后我会收到以下消息

enter image description here

functions.php 的第 1092 行是:

$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

smart-update.js 的第 146 行是:

if(es.rCallback && rCallback && es.rCallback.search(rCallback) != -1) {
window[rCallback](data);
} else {
es.callback(data); <---This line
}

plugin.php 第 1395 行:

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;
}

在我登录站点或使用用户级别低于贡献者的帐户登录时收到此错误消息>.

我不确定为什么会这样或如何解决这个问题。感谢您的帮助。

最佳答案

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

  • 删除作者删除代码的推荐菜单<--这是为我修复错误的更改。
  • 需要 Aihrus Framework 1.1.4
  • 修改保费介绍
  • 更新高级链接

关于javascript - 未捕获的语法错误 : Unexpected token < - Wordpress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23636809/

24 4 0
文章推荐: node.js - fatal error : JS Allocation failed - process out of memory Aborted (core dumped) - Node. js
文章推荐: node.js - 如何在基于 MEAN 堆栈的应用程序中正确实现 Sequelize.js?
文章推荐: javascript - Node/Express 中的环境变量到底是什么?
文章推荐: javascript - 在理解中间件时遇到一些困难
可可西里
个人简介

我是一名优秀的程序员,十分优秀!

滴滴打车优惠券免费领取
滴滴打车优惠券
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com