给定是具有表示表情符号的代码的输入字段.我现在想用相应的表情符号替换此代码.
我的想法是用unicode替换值,但这对我的输入不起作用.只有当我将表情符号本身复制到代码中时,替换才有效.
例:
给定代码:[e-1f60e]
,
转换:😎
,
应该是:
我的问题:如何将给定的代码转换为JavaScript中的表情符号?
$("#tauschen").click(function() {
$('#blub').val(function(index, value) {
return value.replace('[e-1f60e]', '😎'); // Doesn't work
});
});
$("#tauschen2").click(function() {
$('#blub2').val(function(index, value) {
return value.replace('[e-1f60e]', ''); // Works - but how to convert the given string to an emoji?!
});
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p>
Given are strings in an imout field like these, representing an emoji: <strong>[e-1f60e]</strong> </p>
<p>
Now I want to display them "live" as emojis, instead of only the code: 😎 …
Run Code Online (Sandbox Code Playgroud)我想知道如何将一种渐变应用于多个对象。
假设我有十个彼此相邻的圆圈,并且有从黄色到红色的渐变。所有点现在应该一起显示渐变。
例子:
svg {
height: 200px;
overflow: visible;
}
Run Code Online (Sandbox Code Playgroud)
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 297 345">
<defs>
<linearGradient id="Orange_Gelb" x1="0" y1="0" x2="100%" y2="100%" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#ffff25" />
<stop offset="100%" stop-color="#f71818" />
</linearGradient>
</defs>
<g >
<circle class="c1" cx="90" cy="100" r="50" fill="url(#Orange_Gelb)"/>
<circle class="c1" cx="90" cy="200" r="50" fill="url(#Orange_Gelb)"/>
<circle class="c1" cx="90" cy="300" r="50" fill="url(#Orange_Gelb)"/>
<circle class="c1" cx="90" cy="400" r="50" fill="url(#Orange_Gelb)"/>
<circle class="c1" cx="90" cy="500" r="50" fill="url(#Orange_Gelb)"/>
</g>
</svg>
Run Code Online (Sandbox Code Playgroud)
我对安装 Python3 和 Pip 感到完全不知所措。运行后brew install Python3
看来Python3已成功安装。
现在我尝试再次运行Scrapy,但出现此错误:
-bash: /usr/local/bin/scrapy: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我猜是因为Python版本改变了?所以我尝试卸载需要pip的Scrapy。
接下来是下一个问题 - 安装 pip 后(https://pip.pypa.io/en/stable/installing/#install-pip),我看到了这个错误:
Clms:~ userName$ python3 -m pip install -U --force-reinstall pip
Collecting pip
Using cached pip-20.0.2-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
Successfully uninstalled pip-20.0.2
WARNING: The scripts pip, pip3 and pip3.7 are installed in '/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/bin' which is not on PATH.
Consider adding this …
Run Code Online (Sandbox Code Playgroud) 我正在一个有很多代码的项目上。页面完全加载后,JavaScript将删除CSS类。但是我根本找不到负责该行的行,甚至不知道哪个javascript文件包含该行。
是否有可能在时间轴上看到在特定时间调用了什么javascript函数?
当我使用google chrome的devtools的“性能”标签时,可以看到在删除CSS类时,jQuery已完全加载。但是,我怎么看哪条线负责?
或者,是否有办法查看哪些JavaScript函数与DOM元素进行了交互?
谢谢!