我在JSP adobe Cq5中使用了以下scriptlet,现在正在稍微迁移到Adobe。 有下面的代码,这将在点击锚链接打开一个新窗口,相同的功能必须把它写在slightly..can你请帮我在这里将JSP scriptlet转换成Adobe Slightly?
------------------ if(!properties.get("buttonlabel","").equals("")){
String targetUrl ="#";
targetUrl = properties.get("buttonurl","#");
if(targetUrl.startsWith("/content")){
targetUrl = targetUrl+".html";
}
String target = "_self";
if(currentNode.hasProperty("openWindow")){
target = "_blank";
}
%>
<!--
<div class="fcdetails-button-holder">
<a href='<%=targetUrl%>' target ='<%=target%>' name='<%=properties.get("buttonlabel","Title")%> button' id="wp-ctoa_button" class="button" role="button"><%=properties.get("buttonlabel","Title")%></a>
</div>
-->
<div class="fcdetails-button-holder">
<button type="button" id="wp-ctoa_button" class="button" onclick="redirect()"><%=properties.get("buttonlabel","Title")%></button>
</div>
<script type="text/javascript">
function redirect()
{
var url = "<%=targetUrl%>";
window.open(url,"<%=target%>");
}
</script>