是我的“;给我发电子邮件”;按钮代码错误

Is my "email me" button code wrong?

本文关键字:按钮 代码 错误 电子邮件 我的      更新时间:2024-05-31

我的代码一直在说"Unterminated regular expression literal.(第5行,文件"code")"请帮忙这是我的

<FORM>
</INPUT TYPE="button" 
VALUE="click here to add a game"
onClick="parent.location='mailto:1637206@student.ucps.k12.nc.us?subject=I would like to add a game to the website'">
</FORM>

您的开始标记以正斜杠开头,没有结束标记。

<FORM>
<INPUT TYPE="button" 
VALUE="click here to add a game"
onClick="parent.location='mailto:1637206@student.ucps.k12.nc.us?subject=I would like to add a game to the website'"/>
</FORM>

<Input开始,然后用/> 终止标签

由于Wobbles已经回答,INPUT元素的语法无效。

然而,'mailto:1637206@student.ucps.k12.nc.us?subject=I would like to add a game to the website'也是无效的,因为参数subject的值中有空格:它将被解析为subject=I,后面跟着语法分析器无法理解的胡言乱语;您需要对特殊字符进行编码才能可靠地解析:

请确保对所有特殊字符进行编码。下面是常见的字符编码,或者您可以使用Eric Meyer的URL编码工具。如果您想了解所有的字符编码是什么,可以使用此资源。

常见字符编码

  • 空间=%20+(任意一个有效)
  • 换行/回车=%0D%0A
  • 问号=%3F/(正斜杠)=%2F:(冒号)=%3A

您不需要对逗号(,)或句点(.)进行编码。