Vbscript 如何在document.write中使用双引号

Vbscript 如何在document.write中使用双引号,vbscript,Vbscript,我是web编程新手,学习VBScript。我想使用HTML标记在表单中显示几个文本框。但是当使用此语句-document.write(“input type=“text”)创建文本框时,出现了一些问题,网页中没有显示任何内容。我知道我可以在脚本块之外使用HTML创建文本框,但是我们可以在document.write中执行吗?请尝试以下两个选项之一: document.write(“输入类型=\“text\”) document.write(“输入类型='text')) 您正在使用双引号传递doc

我是web编程新手,学习VBScript。我想使用HTML标记在表单中显示几个文本框。但是当使用此语句-document.write(“input type=“text”)创建文本框时,出现了一些问题,网页中没有显示任何内容。我知道我可以在脚本块之外使用HTML创建文本框,但是我们可以在document.write中执行吗?

请尝试以下两个选项之一:

  • document.write(“输入类型=\“text\”)
  • document.write(“输入类型='text'))

  • 您正在使用双引号传递doc.write函数的参数,因此,如果再次使用双引号,则必须将其转义,或者在“text”周围使用单引号,或者尝试以下两个选项之一:

  • document.write(“输入类型=\“text\”)
  • document.write(“输入类型='text'))

  • 您正在使用双引号将doc.write函数的参数传递给它,因此,如果再次使用双引号,您必须将其转义,或者在“text”周围使用单引号,您可以这样做

    <script language=vbscript>
    document.write("input type='text'") '=> input type="text"
    document.write("input type=""text""") '=> input type="text"
    
    'as suggested in other answer won't work 
    'document.write("input type=\"text\"")
    'document.write("input type='text'")
    </script>
    
    
    document.write(“input type='text')=>input type='text'
    document.write(“input type=”“text”“””=>input type=“text”
    “正如其他答案所建议的那样,这是行不通的
    'document.write(“输入类型=\'text\”)
    'document.write(“输入类型='text'))
    
    你可以这样做

    <script language=vbscript>
    document.write("input type='text'") '=> input type="text"
    document.write("input type=""text""") '=> input type="text"
    
    'as suggested in other answer won't work 
    'document.write("input type=\"text\"")
    'document.write("input type='text'")
    </script>
    
    
    document.write(“input type='text')=>input type='text'
    document.write(“input type=”“text”“””=>input type=“text”
    “正如其他答案所建议的那样,这是行不通的
    'document.write(“输入类型=\'text\”)
    'document.write(“输入类型='text'))
    
    始终在字符串中使用两个引号(“”)来表示单个引号

    示例字符串-“亚历克斯:“你好吗”,他说

    Echo“Alex:“你好吗?”他用双引号说


    当您尝试在wbscript中插入html标记时,情况也是如此。希望这有帮助。

    始终在字符串中使用两个引号(“”)来表示单个引号

    示例字符串-“亚历克斯:“你好吗”,他说

    Echo“Alex:“你好吗?”他用双引号说


    当您尝试在wbscript中插入html标记时,情况也是如此。希望这有帮助。

    dit您是否测试您的解决方案?在这两种情况下均不提供任何内容sker使用VBScript标记了此内容。在VBScript中不能用反斜杠转义双引号,因此答案不正确。双引号可以用另一组兔子耳朵转义,如:
    document.write(“input type=”“text”“”)
    dit您测试您的解决方案吗?在这两种情况下均不提供任何内容sker使用VBScript标记了此内容。在VBScript中不能用反斜杠转义双引号,因此答案不正确。双引号可以用另一组兔子耳朵转义,比如:
    document.write(“input type=”“text”“”)
    只是一个更正,当我直接在我的机器中使用此代码时,它不起作用,因为输入是我放在周围的HTML标记。然后它现在起作用了,谢谢。只是一个更正,当我直接在我的机器中使用此代码时,它不起作用,因为输入是我放在周围的一个HTML标记。然后它现在可以工作了,谢谢。