0

任何人都知道我将如何<table> to </table>从使用 jquery 的 ajax 返回的数据中打开。

// BEGIN Subsys_JsHttpRequest_Js
Subsys_JsHttpRequest_Js.dataReady(
  '3599', // this ID is passed from JavaScript frontend
  '<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n          <tr>\n            <td>\n       <script type=\"text/javascript\" language=\"javascript\" src=\"includes/ajax_sc.js\"></script>\n   <div id=\"divShoppingCard\">\n\n    <div class=\"infoBoxHeading\"><a href=\"shopping_cart.php\">Shopping Cart</a></div>\n\n    <div>\n    <div class=\"boxText\">\n<script language=\"javascript\" type=\"text/javascript\">\nfunction couponpopupWindow(url) {\n  window.open(url,\"popupWindow\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150\")\n}\n//--></script><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"left\" valign=\"top\" class=\"infoBoxContents\"><span class=\"infoBoxContents\">1&nbsp;x&nbsp;</span></td><td valign=\"top\" class=\"infoBoxContents\"><a href=\"http://beta.vikingwholesale.com/catalog/eagle-vanguard-limited-edition-p-3769.html\"><span class=\"infoBoxContents\">192 Eagle Vanguard Limited Edition</span></a></td></tr><tr><td align=\"left\" valign=\"top\" class=\"infoBoxContents\"><span class=\"newItemInCart\">4&nbsp;x&nbsp;</span></td><td valign=\"top\" class=\"infoBoxContents\"><a href=\"http://beta.vikingwholesale.com/catalog/family-traditions-adrenaline-avid-black-p-3599.html\"><span class=\"newItemInCart\">085 Family Traditions Adrenaline - Avid, Black</span></a></td></tr><tr><td align=\"left\" valign=\"top\" class=\"infoBoxContents\"><span class=\"infoBoxContents\">1&nbsp;x&nbsp;</span></td><td valign=\"top\" class=\"infoBoxContents\"><a href=\"http://beta.vikingwholesale.com/catalog/painted-pony-paradigm-p-4022.html\"><span class=\"infoBoxContents\">336 Painted Pony Paradigm</span></a></td></tr></table></div>\n\n\n    <div class=\"boxText\"><img src=\"images/pixel_black.gif\" width=\"100%\" height=\"1\" alt=\"\"/></div>\n\n\n    <div class=\"boxText\">$940.00</div>\n\n\n</div>\n\n\n          \n         </div><!--end of divShoppingCard-->\n       </td>\n     </tr></table>',
  null
)
// END Subsys_JsHttpRequest_Js
4

1 回答 1

0

这就是我最终所做的,不确定它与网站的其他部分的兼容性如何。

$text = $this->_php2js(stripslashes(trim(html_entity_decode($text, ENT_QUOTES))));
/* 
$text = 
    "// BEGIN Subsys_JsHttpRequest_Js\n" . 
    "Subsys_JsHttpRequest_Js.dataReady(\n" . 
        "  " . $this->_php2js($this->SCRIPT_ID) . ", // this ID is passed from JavaScript frontend\n" . 
        "  " . $this->_php2js(trim($text)) . ",\n" . 
        "  " . $result . "\n" . 
    ")\n" . 
    "// END Subsys_JsHttpRequest_Js\n" . 
"";
 * 
 */ 

谢谢

于 2013-11-12T21:50:36.630 回答