+ -
当前位置:首页 → 问答吧 → function 问题

function 问题

时间:2011-06-22

来源:互联网

VBScript code
Function loadHtml(FileName)
    Dim Html,Head,Foot
    Head = readFile(webapp & "template/default/header.html")
    Foot = readFile(webapp & "template/default/footer.html")
    Html = Head + readFile(webapp & "template/default/" & FileName & ".html") + Foot
    Html = webReplace(Html)
    'Response.Write Html ' 这里有内容
    loadHtml = Html
End Function
Html = loadHtml("news")
    Response.Write Html ' 这里没内容

作者: cooc123   发布时间: 2011-06-22

很显然,你的全局变量Html 跟你的局部变量重名了。
Html = loadHtml("news")
  Response.Write Html ' 这里没内容
改成
Html1 = loadHtml("news")
  Response.Write Html1 ' 这里没内容

作者: lzp4881   发布时间: 2011-06-22