我现在有个.asp跟.html结尾的文件网站代码怎么运行在本地服务器上需要搭建什么环境

html-css011

我现在有个.asp跟.html结尾的文件网站代码怎么运行在本地服务器上需要搭建什么环境,第1张

1、安装完整的web服务器IIS。安装完成后,需要做好相应的配置以及iis网站的建立。建议参考网上的教程一步一步来操作。第一次接触麻烦一些,但是会了后,和正式服务器网站是一样的。建议安装学习

2、还有1种是:简易IIS服务器。绿色软件,无需安装。网上搜一下简易IIS服务器有下载。只作为网站简单的调试和测试,复杂的比如有组件类的asp程序可能无法正常完美使用。

使用步骤:1.安装gulp以及gulp-file-include(NodeJs上)

2.新建gulpfile.js,配置 gulp-file-include:

var gulp =require('gulp')//引入gulp

var fileinclude  =require('gulp-file-include')//引入gulp-file-include

gulp.task('fileinclude', function() {

    gulp.src('src/**.html') .pipe(fileinclude({//gulp.src中存放要编译的文件

           prefix:'@@',

           basepath:'@file'

    })).pipe(gulp.dest('dist'))//gulp.dest中存放编译后的文件的存放地址

})

3.通过@@include('include/header.html')引用header.html

4.在命令行工具里,执行gulp fileinclude。执行完毕后,dist目录里就有相对应的html文件。

使用步骤:1.安装gulp-ejs(NodeJs上)

2.新建gulpfile.js,配置 gulp-file-include:

var gulp = require('gulp')//引入gulp

var ejs  = require('gulp-ejs')//引入gulp-ejs

gulp.task('ejs', function() {

     gulp.src('Views/Business/financeManage1.ejs')//gulp.src中存放要编译的文件

         .pipe(ejs({},{ext: '.html'}))//设置生成的文件后缀名为html

        .pipe(gulp.dest('Views/dist'))//gulp.dest中存放编译后的文件的存放地址

})

3.通过<%-include ../template.html  %>引用template.html

4.在命令行工具里,执行gulp ejs。执行完毕后,dist目录里就有相对应的html文件。

1.将项目放于本地服务器如xampp下

2.<iframe src="../template.html" width="100%" onload="reinitIframeEND()"></iframe>

3.function reinitIframe(){

        var iframe = document.getElementById("iframepage")

        console.log(iframe)

        try{

            var bHeight = iframe.contentWindow.document.body.scrollHeight

            var dHeight = iframe.contentWindow.document.documentElement.scrollHeight

            var height = Math.max(bHeight, dHeight)

            iframe.height = height

        }catch (ex){

            console.log(ex)

        }

}

var timer1 = window.setInterval("reinitIframe()", 500)//定时开始

function reinitIframeEND(){

        var iframe = document.getElementById("iframepage")

        console.log("3")

        try{

            var bHeight = iframe.contentWindow.document.body.scrollHeight

            var dHeight = iframe.contentWindow.document.documentElement.scrollHeight

            var height = Math.max(bHeight, dHeight)

            console.log(bHeight+":"+dHeight)

            iframe.height = height

      }catch (ex){

            console.log(ex)

     }

     // 停止定时

     window.clearInterval(timer1)

}