我是VBscript的新手,所以可能有一个非常简单的解决方案。无法在VBscript中访问GET变量
基本上,我有我的主页与按钮,真的只是作为链接到其他网页。在链接我想传递的信息,所以我用的是标准的变量=值,如下所示:?
<input type="button" name="saveButton" value="Save Systems" onclick="location.href='save.html?step=1'" />
<input type="button" name="loadButton" value="Load Systems" onclick="location.href='load.html?step=1'" />
我抬头如何访问我看了看说使用的Request.QueryString(GET VBScript和每一个地方变量“variableName”)
因此,在我的save.html页面中,我试图首先打印step的值,只是为了确保我得到它,然后开始实际处理所有代码。这是我挂断的地方。
<script type="text/vbscript">
document.write("<p>in the script<br>")
document.write("stepVar = ")
stepVar = Request.QueryString("step")
document.write(stepVar)
document.write(stepVar & "</p>")
</script>
... (rest of the page)
(我试过2条不同的打印语句,以防万一我被错误地串联,但既不工作。)当我点击我保存的主网页按钮,导致我save.html?步= 1时,打印
in the script
stepVar =
(rest of the page)
所以我想步骤是回来null?这是不是因为我没有通过表单提交我的变量的原因?这应该不会有什么关系......对吧?为什么我没有得到我的变量/我如何获得“step”的值,以便根据变量的值采取不同的操作?
谢谢,这应该是一个好的开始...我知道我很奇怪我使用VBScript而不使用ASP,但这是因为我正在为AGI的STK编写一个gui工具。我想我应该能够使用JavaScript的界面部分,所以也许我会做的。 – Lauren 2010-07-12 17:52:35