我想把这个PHP代码推送到javascript变量就像一个字符串, 它可以吗?
$APPLICATION->IncludeComponent("wt:static.content", "bonus10", array(
"DEFAULT_LANG" => array(
0 => "",
),
"LANGUAGE_ID" => "",
"USE_DEFAULT" => "Y",
"INCLUDE_LANGUAGE" => "",
"CACHE_TYPE" => "Y",
"CACHE_TIME" => "3600"
),
false,
array(
"ACTIVE_COMPONENT" => "Y",
"HIDE_ICONS" => "N"
)
);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
答案 0 :(得分:2)
var string = '$APPLICATION->IncludeComponent("wt:static.content", "bonus10",
array("DEFAULT_LANG" => array(0 => "",),
"LANGUAGE_ID" => "",
"USE_DEFAULT" => "Y",
"INCLUDE_LANGUAGE" => "",
"CACHE_TYPE" => "Y",
"CACHE_TIME" => "3600"),
false,array("ACTIVE_COMPONENT" => "Y",
"HIDE_ICONS" => "N"));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>';