我正致力於將數據發送到ajax。如何在php中退出javascript代碼
$phpArray = array("ok", "
<script>
mygallery = [
{type: "image", image: "img/gallery/slider/1.jpg", thmb: "img/gallery/slider/thumbs/1.jpg", alt: "", title: "", description: "", titleColor: "#000000", descriptionColor: "#000000"},
{type: "image", image: "img/gallery/slider/2.jpg", thmb: "img/gallery/slider/thumbs/2.jpg", alt: "", title: "", description: "", titleColor: "#000000", descriptionColor: "#000000"},
</script>"
);
echo json_encode($phpArray);
如何正確執行此操作?我曾嘗試在網上的javascript逃走,但doesn't工作
而且問題是 –
問題是我無法得到它的工作,因爲我有(」「) – MANGA
剛剛在本地運行,並按照我的預期工作 –