小编Mat*_*hew的帖子

如何在JavaScript中转义单引号(')?

更新: 我想对这个问题给出一个更新的答案.首先,让我说明如果您正在尝试完成下面的操作,我建议您通过添加事件侦听器来管理事件.我强烈建议您为项目使用jQuery,并使用它们的语法来管理使用DOM的事件监听器.

好的,我基本上是这样做的:

document.getElementById("something").innerHTML = "<img src='something' onmouseover='change(\'ex1\')' />";
Run Code Online (Sandbox Code Playgroud)

我不想要双引号(")我把它放在''.我只想要一个单引号,所以我试图在使用它时不要把它放一个双.我试图在最后的结果达到这个.

<img src="something" onmouseover="change('ex1')" />
Run Code Online (Sandbox Code Playgroud)

逃避对我不起作用.

明确的答案很好,然而,更清洁(更专业的方式,IMO)是 loganfsmyth的答案.

html javascript escaping

178
推荐指数
5
解决办法
50万
查看次数

iFrames之间的沟通?

你怎么能让两个iFrame相互通话?例如,我是第二个iframe的元素值,第一个iframe上有显示元素.我需要从第2帧到第1帧获得值.我该怎么做?不要说使用cookies,因为大量数据会造成伤害.

html javascript iframe

12
推荐指数
2
解决办法
2万
查看次数

您没有权限的Localhost

标题:403禁止禁止

您无权访问此服务器上的/.

我安装后尝试用Apache访问它.但它给了我这个错误.无论如何我可以解决这个问题?

DOC ROOT:C:\ webserver\Apache24 \

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the …
Run Code Online (Sandbox Code Playgroud)

apache localhost

0
推荐指数
1
解决办法
2906
查看次数

标签 统计

html ×2

javascript ×2

apache ×1

escaping ×1

iframe ×1

localhost ×1