在Eclipse中,我导入了一个使用maven jetty插件的基于maven的项目.如果我从命令行运行mvn jetty:run,一切正常.如果我在Eclipse中添加运行配置并尝试运行它,我会收到错误消息:
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/eugene/.m2/repository), central (http://repo1.maven.org/maven2)] -> [Help 1]
在Eclipe运行配置中,我使用:
${project_loc}jetty:run我读了[ Help1 ]页.我在maven配置文件中没有pluginGroup设置,但我有pom.xml中提到的jetty插件,所以我想一切都应该没问题(特别是因为一切都在命令行中运行).在执行jetty运行配置之前,我尝试在Eclipse中"Run as> Maven clean",但它没有帮助.项目编译并传递所有测试,只有jetty:run在Eclipse中不起作用.
请帮帮忙,我是Eclipse&Maven的新手.提前致谢.
我有一个XHTML页面,其中SVG作为<svg>元素嵌入其中.我需要实现缩放,但是要求内部<text>元素不能缩放.一个明显的解决方案是
<svg ...>
<!-- Root <g> to programmatically `setAttribute("transform", ...)` -->
<g transform="scale(0.5)">
<!-- Various inner elements here -->
<!-- Here is a text element.
Additional <g> is to apply text position which
*must* depend on the scaling factor set above -->
<g transform="translate(100 50)">
<!-- Apply the opposite scaling factor.
Must be done for every `<text>` element on each change of the scaling factor... -->
<text x="0" y="0" transform="scale(2)">Hello, World!</text>
</g>
</g>
</svg>
Run Code Online (Sandbox Code Playgroud)
有比这更好的解决方案吗?也许,有一种方法可以"重置"内部<text> …
在下面的示例中,return false在Firefox 3.6或Chrome 10中单击链接(因为页面滚动到顶部)但在Internet Explorer中工作后似乎不会阻止默认操作.
使用event.preventDefault()做我需要的,但我想知道为什么return false不与其他人一起工作.
附注:我不需要支持Internet Explorer.
<script>
addEventListener("DOMContentLoaded", function(){
document.getElementById("link").addEventListener("click", function(){
alert("Clicked!");
return false;
}, false);
alert("Click handler bound!");
}, false);
</script>
<div style="margin-top: 1200px;">
<a id="link" href="#">Click me!</a>
</div>
Run Code Online (Sandbox Code Playgroud)