<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_gr_sc_cat_item" jelly="true" object="true">
var gr = new GlideRecordSecure('sc_cat_item');
gr.addEncodedQuery('descriptionLIKEhref=^active=true');
gr.addJoinQuery('sys_user', 'sys_created_by', 'user_name');
gr.orderByDesc('sys_created_on');
gr.query();
gr;
</g2:evaluate>
<j2:set var="jvar_count" value="1"/>
<head>
<script language="javascript">
function checkBlankLink( id, tid) {
var s = document.getElementById(tid).value;
var finda = s.match(/href=/g);
var findb = s.match(/target="_blank"/g);
var a=0;
var b=0;
if(finda) {
a = finda.length;
}
if(findb) {
b = findb.length;
}
if(a==b)
{
//alert(a+', '+b);
document.getElementById(id).innerHTML='OK';
}
}
</script>
</head>
<body >
<h2>Category Item Target Blank</h2>
<table id="headerTable" border="1" width="100%" cellpadding="10pt">
<tr>
<td>#</td>
<td>OK = All Blank</td>
<td>name</td>
<td>short_description</td>
<td>sys_created_by</td>
<td>sys_created_on</td>
<td>sys_id</td>
</tr>
<j2:while test="$[ jvar_gr_sc_cat_item.next() ]">
<tr>
<td>
$[jvar_count]
<j2:set var="jvar_count" value="$[jvar_count+1]"/>
</td>
<td align="center">
<div id="lbl_$[jvar_gr_sc_cat_item.getValue('sys_id')]" style="color:red"></div>
<textarea id="t_$[jvar_gr_sc_cat_item.getValue('sys_id')]" style="display:none">$[jvar_gr_sc_cat_item.getValue('description')]</textarea>
<script language="javascript">
checkBlankLink("lbl_$[jvar_gr_sc_cat_item.getValue('sys_id')]", "t_$[jvar_gr_sc_cat_item.getValue('sys_id')]");
</script>
</td>
<td>
<a href="sc_cat_item.do?sys_id=$[jvar_gr_sc_cat_item.getValue('sys_id')]" target="_blank">$[jvar_gr_sc_cat_item.getValue('name')]</a>
</td>
<td>
$[jvar_gr_sc_cat_item.getValue('short_description')]
</td>
<!--
<td style="padding:10px;white-space: pre;">
$[jvar_gr_sc_cat_item.getValue('description')]
</td>
-->
<td>
$[jvar_gr_sc_cat_item.getValue('sys_created_by')]
</td>
<td>
$[jvar_gr_sc_cat_item.getValue('sys_created_on')]
</td>
<td>
$[jvar_gr_sc_cat_item.getValue('sys_id')]
</td>
</tr>
</j2:while>
</table>
</body>
</j:jelly>
沒有留言:
張貼留言