Javascript 如何转换a<;脚本></脚本>;到JS文件?
我想把这段代码转换成JS文件,我该怎么做Javascript 如何转换a<;脚本></脚本>;到JS文件?,javascript,Javascript,我想把这段代码转换成JS文件,我该怎么做 <script>jQuery.extend(Drupal.settings, {"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"bakery","theme_token":"AhPPZ3SDBljxZcHVdM65UHxrqCJJYdhsgmv3-xYfB54","js":{"js/owl.carousel.min.js":1,"js/owlcarousel.settings
<script>jQuery.extend(Drupal.settings, {"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"bakery","theme_token":"AhPPZ3SDBljxZcHVdM65UHxrqCJJYdhsgmv3-xYfB54","js":{"js/owl.carousel.min.js":1,"js/owlcarousel.settings.js":1,"js/jquery.min.js":1,"js/jquery.once.js":1,"js/drupal.js":1,"js/jquery.cookie.js":1,"js/views-bootstrap-carousel.js":1,"js/wow.min.js":1,"0":1,"js/gmap3.min.js":1,"js/modernizr.js":1,"js/jquery.migrate.js":1,"js/bootstrap.min.js":1,"js/jquery.scrollTo.min.js":1,"js/jquery.stellar.min.js":1,"js/placeholder-fallback.js":1,"js/jquery.inview.min.js":1,"js/custom.js":1,"/script.js":1},"css":{"css/system.base.css":1,"css/owl.carousel.css":1,"css/owl.theme.css":1,"css/owl.transitions.css":1,"css/simplenews.css":1,"css/field.css":1,"css/views.css":1,"css/ckeditor.css":1,"css/ctools.css":1,"css/panels.css":1,"css/flexible.css":1,"css/37dc7e2bbbb736c2821f5c72064eb694.css":1,"css/font-awesome.min.css":1,"css/bootstrap.min.css":1,"css/animate.css":1,"css/main.css":1,"css/style.css":1}},"viewsBootstrap":{"carousel":{"1":{"id":1,"name":"sliderhome","attributes":{"interval":5000,"pause":"hover"}}}},"urlIsAjaxTrusted":{"\/":true},"owlcarousel":{"owl-carousel-block_110":{"settings":{"items":4,"itemsDesktop":["1199",4],"itemsDesktopSmall":["979",3],"itemsTablet":["768",2],"itemsTabletSmall":["0",0],"itemsMobile":["479",1],"singleItem":false,"itemsScaleUp":false,"slideSpeed":200,"paginationSpeed":800,"rewindSpeed":1000,"autoPlay":"5000","stopOnHover":false,"navigation":false,"navigationText":["prev","next"],"rewindNav":true,"scrollPerPage":false,"pagination":true,"paginationNumbers":false,"responsive":true,"responsiveRefreshRate":200,"baseClass":"owl-carousel","theme":"owl-theme","lazyLoad":false,"lazyFollow":true,"lazyEffect":"fadeIn","autoHeight":false,"jsonPath":false,"jsonSuccess":false,"dragBeforeAnimFinish":true,"mouseDrag":true,"touchDrag":true,"addClassActive":false,"transitionStyle":false},"views":{"ajax_pagination":0}},"owl-carousel-block8":{"settings":{"items":5,"itemsDesktop":["1199",4],"itemsDesktopSmall":["979",3],"itemsTablet":["768",2],"itemsTabletSmall":["0",0],"itemsMobile":["479",1],"singleItem":true,"itemsScaleUp":false,"slideSpeed":200,"paginationSpeed":800,"rewindSpeed":1000,"autoPlay":"5000","stopOnHover":false,"navigation":false,"navigationText":["",""],"rewindNav":true,"scrollPerPage":false,"pagination":true,"paginationNumbers":false,"responsive":true,"responsiveRefreshRate":200,"baseClass":"owl-carousel","theme":"owl-theme","lazyLoad":false,"lazyFollow":true,"lazyEffect":"fadeIn","autoHeight":false,"jsonPath":false,"jsonSuccess":false,"dragBeforeAnimFinish":true,"mouseDrag":true,"touchDrag":true,"addClassActive":false,"transitionStyle":false},"views":{"ajax_pagination":0}},"owl-carousel-block5":{"settings":{"items":3,"itemsDesktop":["1199",3],"itemsDesktopSmall":["979",2],"itemsTablet":["768",2],"itemsTabletSmall":["0",0],"itemsMobile":["479",1],"singleItem":false,"itemsScaleUp":false,"slideSpeed":200,"paginationSpeed":800,"rewindSpeed":1000,"autoPlay":"5000","stopOnHover":false,"navigation":true,"navigationText":["",""],"rewindNav":true,"scrollPerPage":false,"pagination":false,"paginationNumbers":false,"responsive":true,"responsiveRefreshRate":200,"baseClass":"owl-carousel","theme":"owl-theme","lazyLoad":false,"lazyFollow":true,"lazyEffect":"fadeIn","autoHeight":false,"jsonPath":false,"jsonSuccess":false,"dragBeforeAnimFinish":true,"mouseDrag":true,"touchDrag":true,"addClassActive":false,"transitionStyle":false},"views":{"ajax_pagination":0}}},"bootstrap":{"anchorsFix":1,"anchorsSmoothScrolling":1,"popoverEnabled":1,"popoverOptions":{"animation":1,"html":0,"placement":"right","selector":"","trigger":"click","title":"","content":"","delay":0,"container":"body"},"tooltipEnabled":1,"tooltipOptions":{"animation":1,"html":0,"placement":"auto left","selector":"","trigger":"hover focus","delay":0,"container":"body"}}});</script>
jQuery.extend(Drupal.settings,{“basePath”:“\/”,“pathPrefix”:“ajaxPageState”:{“theme”:“bakery”,“theme”;“theme”;“AhPPZ3SDBljxZcHVdM65UHxrqCJJYdhsgmv3-xfb54”,“js”:{“js/owl.carousel.min.js”:1,“js/owlcarousel.settings.js”:1,“js/jQuery.min.js”:1,“js/jQuery.com.js”carousel:1,“bootstrap”视图,“js/wow.min.js”:1,“0”:1,“js/gmap3.min.js”:1,“js/modernizer.js”:1,“js/jquery.migrate.js”:1,“js/bootstrap.min.js”:1,“js/jquery.stellar.min.js”:1,“js/placeholder fallback.js”:1,“js/jquery.inview.min.js”:1,“js/custom.js”:1,“/script.css”:1},“js”:{“css/system.base.css”:1,“css.css”carouse.css”:1,“owl”主题css/owl.transitions.css:1,“css/simplenews.css”:1,“css/field.css”:1,“css/ckeditor.css”:1,“css/ctool.css”:1,“css/panels.css”:1,“css/flexible.css”:1,“css/font.min.css”:1,“awesome/bootstrap.min.css”:1,“css/animate.css”:1,“css/main.css”:1,“css/style.css”:1},“viewsBootstrap”{旋转木马:{“1”:{“id”:1,“name”:“sliderhome”,“attributes”:{“interval”:5000,“pause”:“hover”}}},“urlIsAjaxTrusted”:{“\/”:true},“owlcarousel”:{“owl-carousel-block\u 110”:{“settings”:{“items”:4,“itemsDesktopSmall”:[“1199”,4],“itemsDesktopSmall”:[“979”,3],“itemsTablet”[“768”,2],“itemsTabletSmall”:“itemsall”[“0],“itemsobile”;“itemstopsallessmall”;“items],“items”;“single”;“items”;“items479],“item”;“iteitemsScaleUp:“false”,“slideSpeed:”200,“paginationSpeed:”800,“rewindSpeed:”1000,“autoPlay:”5000,“stopOnHover:”false,“navigation:”false,“navigationText:”[“prev”,“next”],“rewindNav:”true,“scrollPerPage:”false,“pagination:”true,“PaginationNumber:”false,“Responsived:”true,“ResponsiveFreshrate:”200,“baseClass:“猫头鹰旋转木马”,“主题”:“猫头鹰主题”,”“lazyLoad”:false,“lazyFollow”:true,“lazyEffect”:“fadeIn”,“autoHeight”:false,“jsonPath”:false,“jsonSuccess”:false,“DragBeforInFinish”:true,“mouseDrag”:true,“touchDrag”:true,“addClassActive”:false,“transitionStyle”:false},“视图”:{“ajax_分页”:0},“owl-carousel-block8”:{“设置”:{“items”:5,“itemsDesktop”:“1199”,4],“itemsdesktopmall”:“979”:“,3],“itemsTablet”:[“768”,2],“itemsTabletSmall”:[“0”,0],“itemsMobile”:[“479”,1],“singleItem”:true,“itemscaleup”:false,“slideSpeed”:200,“分页速度”:800,“倒带速度”:1000,“自动播放”:“5000”,“停止悬停”:false,“导航”:false,“导航文本”:[“”,“,”,“倒带导航”:true,“滚动页面”:false,“分页”:true,“分页编号”:false,“responsive”:true,“responsiveRefreshRate”:200,“baseClass”:“owl carousel”,“theme”:“owl theme”,“lazyLoad”:false,“lazyFollow”:true,“lazyEffect”:“fadeIn”,“autoHeight”:false,“jsonPath”:false,“jsonSuccess”:false,“dragbeforeainimfinish”:true,“mouseDrag”:true,“touchDrag”:true,“addClassActive”:false,“transitionStyle”:false”,view:{“ajax_pagination”:0},”owl-carousel-block5:“{”设置“:{”项目“:”项目“:”项目“:”项目“:”项目“:”项目“:”项目“:”项目“:”设置“:”项目“:”设置“:”项目“:”设置“:”项目“:”设置“:”项目“:”项目“:”设置“:”项目“:”错误“,”项目设置“,”幻灯片“:”200,“分页速度“:”800”,“倒带速度“:”1000”,“自动播放“:”5000”,“停止悬停“:”错误“,”导航“:”正确“,”导航文本“:”,“touchDrag”:true,“addClassActive”:false,“transitionStyle”:false},“views”:{“ajax分页”:0}}},“bootstrap”:{“AnchorFix”:1,“AnchorSmoothScrolling”:1,“popoverEnabled”:1,“PopovereOptions”:{“animation”:1,“html”:0,“placement”:“right”,“selector”:“trigger”:“click”,“title”:“content”:“delay”:0,“container”:“body”;“body”;“ToolTiped”:“1,”工具提示选项:{“动画”:1,“html”:0,“位置”:“自动向左”,“选择器”:“触发器”:“悬停焦点”,“延迟”:0,“容器”:“主体”}};
打开记事本(或IDE,强烈推荐),复制
和
中的内容,然后使用扩展名.js
保存文件。现在使用
<script src="{path-to-file}/myScript.js"></Script>