Jenkins Email template not working - email

I am trying to customize jenkins email template by adding jelly script. The script is working fine , but i am not getting the colour balls in mail, the balls are greyed out.
Below is the script. Can anyone please assist what changes needs to be done to the script so that colour balls will appear in jenkins emails.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
h1 { color:black; }
h2 { color:black; }
h3 { color:black; }
TD.bg1 { color:white; background-color:#0000C0; font-size:120% }
TD.bg2 { color:white; background-color:#4040FF; font-size:110% }
TD.bg3 { color:white; background-color:#8080FF; }
TD.test_passed { color:blue; }
TD.test_failed { color:red; }
TD.console { font-family:Courier New; }
</STYLE>
<BODY>
<j:set var="spc" value="&nbsp;&nbsp;" />
<!-- GENERAL INFO -->
<TABLE>
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
</TD><TD valign="center"><B style="font-size: 200%;">BUILD ${build.result}</B></TD></TR>
<TR><TD>Build URL</TD><TD>${rooturl}${build.url}</TD></TR>
<TR><TD>Project:</TD><TD>${project.name}</TD></TR>
<TR><TD>Date of build:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Build duration:</TD><TD>${build.durationString}</TD></TR>
</TABLE>
<BR/>
<!-- CHANGE SET -->
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>CHANGES</B></TD></TR>
<j:forEach var="cs" items="${changeSet}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<j:set var="aUser" value="${cs.hudsonUser}"/>
<TR>
<TD colspan="2" class="bg2">${spc}Revision <B>${cs.commitId?:cs.revision?:cs.changeNumber}</B> by
<B>${aUser!=null?aUser.displayName:cs.author.displayName}: </B>
<B>(${cs.msgAnnotated})</B>
</TD>
</TR>
<j:forEach var="p" items="${cs.affectedFiles}">
<TR>
<TD width="10%">${spc}${p.editType.name}</TD>
<TD>${p.path}</TD>
</TR>
</j:forEach>
</j:forEach>
<j:if test="${!hadChanges}">
<TR><TD colspan="2">No Changes</TD></TR>
</j:if>
</TABLE>
<BR/>
</j:if>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TABLE width="100%">
<TR><TD class="bg1"><B>BUILD ARTIFACTS</B></TD></TR>
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</TABLE>
<BR/>
</j:if>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<TABLE width="100%">
<TR><TD class="bg1"><B>BUILD ARTIFACTS</B></TD></TR>
<j:forEach var="m" items="${mbuilds}">
<TR><TD class="bg2"><B>${m.key.displayName}</B></TD></TR>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</j:if>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR>
<j:forEach var="failed_test" items="${packageResult.getFailedTests()}">
<TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Failed: ${failed_test.getFullName()} </li></B></TD></TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- COBERTURA TEMPLATE -->
<j:set var="coberturaAction" value="${it.coberturaAction}" />
<j:if test="${coberturaAction!=null}">
<j:set var="coberturaResult" value="${coberturaAction.result}" />
<j:if test="${coberturaResult!=null}">
<table width="100%"><TD class="bg1" colspan="2"><B>Cobertura Report</B></TD></table>
<table width="100%"><TD class="bg2" colspan="2"><B>Project Coverage Summary</B></TD></table>
<table border="1px" class="pane">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<tr>
<td>${coberturaResult.name}</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td data="${coberturaResult.getCoverage(metric).percentageFloat}">${coberturaResult.getCoverage(metric).percentage}%
(${coberturaResult.getCoverage(metric)})
</td>
</j:forEach>
</tr>
</table>
<j:if test="${coberturaResult.sourceCodeLevel}">
<h2>Source</h2>
<j:choose>
<j:when test="${coberturaResult.sourceFileAvailable}">
<div style="overflow-x:scroll;">
<table class="source">
<thead>
<tr>
<th colspan="3">${coberturaResult.relativeSourcePath}</th>
</tr>
</thead>
${coberturaResult.sourceFileContent}
</table>
</div>
</j:when>
<j:otherwise>
<p>
<i>Source code is unavailable</i>
</p>
</j:otherwise>
</j:choose>
</j:if>
<j:forEach var="element" items="${coberturaResult.childElements}">
<j:set var="childMetrics" value="${coberturaResult.getChildMetrics(element)}"/>
<table width="100%"><TD class="bg2" colspan="2">Coverage Breakdown by ${element.displayName}</TD></table>
<table border="1px" class="pane sortable">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${childMetrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<j:forEach var="c" items="${coberturaResult.children}">
<j:set var="child" value="${coberturaResult.getChild(c)}"/>
<tr>
<td>
${child.xmlTransform(child.name)}
</td>
<j:forEach var="metric" items="${childMetrics}">
<j:set var="childResult" value="${child.getCoverage(metric)}"/>
<j:choose>
<j:when test="${childResult!=null}">
<td data="${childResult.percentageFloat}">${childResult.percentage}%
(${childResult})
</td>
</j:when>
<j:otherwise>
<td data="101">N/A</td>
</j:otherwise>
</j:choose>
</j:forEach>
</tr>
</j:forEach>
</table>
</j:forEach>
</j:if>
<BR/>
</j:if>
<!-- CONSOLE OUTPUT -->
<j:getStatic var="resultFailure" field="FAILURE" className="hudson.model.Result"/>
<j:if test="${build.result==resultFailure}">
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR><TD class="bg1"><B>CONSOLE OUTPUT</B></TD></TR>
<j:forEach var="line" items="${build.getLog(100)}"><TR><TD class="console">${line}</TD></TR></j:forEach>
</TABLE>
<BR/>
</j:if>
</BODY>
</j:jelly>

change the img src to a website address..something like :
img src="https://raw.githubusercontent.com/jenkinsci/jenkins/master/war/src/main/webapp/images/32x32/green.gif"

Related

modal popup does not work on button click in tab container

I have a page which contains multiple tab. I need to have one modal popup to be popped up to show different message. I tried in the following ways but failed.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="userUpdatePanel" runat="server">
<ContentTemplate>
<center style="margin-top: 0px">
<ajaxToolkit:TabContainer ID="TabContainer1" AutoPostBack="true" runat="server" ActiveTabIndex="0">
<cc1:TabPanel runat="server" HeaderText="Country" ID="TabPanel1">
<ContentTemplate>
<center>
<input type="hidden" id="hidUserID" runat="server" value="0" />
<table class="contentTable">
<tr class="contentRow">
<td class="columnName">
Action
</td>
<td class="columnData">
<asp:RadioButtonList ID="rbtnCountryAddorModify" RepeatDirection="Horizontal" AutoPostBack="true"
runat="server" >
<asp:ListItem Value="Add" Selected="True">Add</asp:ListItem>
<asp:ListItem Value="Modify">Modify</asp:ListItem>
</asp:RadioButtonList>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="columnName">
Country
</td>
<td class="columnData">
<ajaxToolkit:ComboBox ID="cmbCountry" runat="server" AutoPostBack="true"
CssClass="AjaxToolkitStyle" DropDownStyle="DropDown" CausesValidation="True"
onselectedindexchanged="cmbCountry_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>
</ajaxToolkit:ComboBox>
</td>
<td></td>
</tr>
<tr class="alternateRow">
<td class="columnName">
New Country Name
</td>
<td class="columnData">
<asp:TextBox ID="txtCountryName" runat="server" Width="230px" ValidationGroup="user"></asp:TextBox>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="buttonRow" colspan="2">
<asp:button ID="btnSaveCountry" runat="server" text="Submit" OnClick="btnSaveCountry_Click"
/>
<asp:Button ID="reset" runat="server" Text="reset" OnClick="reset_Click" />
<asp:Button ID="Button1" runat="server" Text="Hiden" />
</td>
</tr>
</table>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" >
<br />
<asp:Label ID="lblMsg" runat="server" Height="30px" ForeColor="red"></asp:Label>
<table style="width: 270px">
<tr>
<td >
</td>
<td>
<asp:Button ID="btnCancel" runat="server" Text="Ok" />
</tr>
</table>
</asp:Panel>
<cc1:ModalPopupExtender ID="ModalPopupExtenderMsg" runat="server"
TargetControlID="Button1"
PopupControlID="Panel1"
BackgroundCssClass="modalBackground"
DropShadow="true"
CancelControlID="btnCancel" >
</cc1:ModalPopupExtender>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" AutoPostBack="true" runat="server" HeaderText="Division">
<ContentTemplate>
<center>
<input type="hidden" id="Hidden1" runat="server" value="0" />
<table class="contentTable">
<tr class="contentRow">
<td class="columnName">
Action
</td>
<td class="columnData">
<asp:RadioButtonList ID="rbtnDivProvAddorModify" RepeatDirection="Horizontal" AutoPostBack="true"
runat="server" >
<asp:ListItem Value="Add" Selected="True">Add</asp:ListItem>
<asp:ListItem Value="Modify">Modify</asp:ListItem>
</asp:RadioButtonList>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="columnName">
Country
</td>
<td class="columnData">
<ajaxToolkit:ComboBox ID="cmbCountryForDiv" runat="server" AutoPostBack="true"
CssClass="AjaxToolkitStyle" DropDownStyle="DropDown" CausesValidation="True"
onselectedindexchanged="cmbCountryForDiv_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>
</ajaxToolkit:ComboBox>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="columnName">
Division/Province
</td>
<td class="columnData">
<ajaxToolkit:ComboBox ID="cmbDivision" runat="server" AutoPostBack="true"
CssClass="AjaxToolkitStyle" DropDownStyle="DropDown" CausesValidation="True"
onselectedindexchanged="cmbDivision_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>
</ajaxToolkit:ComboBox>
</td>
<td></td>
</tr>
<tr class="alternateRow">
<td class="columnName">
New Division/Province Name
</td>
<td class="columnData">
<asp:TextBox ID="txtDivProvince" runat="server" Width="230px" ValidationGroup="user"></asp:TextBox>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="buttonRow" colspan="2">
<asp:button ID="btnSaveDivision" runat="server" text="Submit" OnClick="btnSaveDivision_Click"
/>
<asp:Button ID="Button3" runat="server" Text="reset" OnClick="reset_Click" />
</td>
</tr>
</table>
</ContentTemplate>
<cc1:TabPanel ID="TabPanel4" AutoPostBack="true" runat="server" HeaderText="Thana">
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel5" AutoPostBack="true" runat="server" HeaderText="Municipality">
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel6" AutoPostBack="true" runat="server" HeaderText="UPHeadQuarter">
</cc1:TabPanel>
</ajaxToolkit:TabContainer>
<asp:Button ID="Button4" runat="server" Text="pOPUp" onclick="Button4_Click" />
<asp:Button ID="Button2" runat="server" Visible="false" Text="Hidden" />
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="Button2"
PopupControlID="Panel4"
BackgroundCssClass="modalBackground"
DropShadow="true"
CancelControlID="Button7" >
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel4" runat="server" CssClass="modalPopup" Style="display: none" >
<br />
<asp:Label ID="Label3" runat="server" Height="30px" ForeColor="red"></asp:Label>
<table style="width: 270px">
<tr>
<td >
</td>
<td>
<asp:Button ID="Button7" runat="server" Text="Ok" />
</tr>
</table>
</asp:Panel>
</center>
</ContentTemplate>
</asp:UpdatePanel>
In .cs file I have the code as follows.
protected void showModalMsgBox(string msg,AjaxControlToolkit.ModalPopupExtender mdlPopupMsg) {
switch (msg)
{
case "success":
lblMsg.Text = "Data saved successfully.";
break;
default:
lblMsg.Text = "Data is not saved. Please contact with administrator.";
break;
}
//userUpdatePanel.Update();
mdlPopupMsg.Show();
}
protected void btnSaveDivision_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtenderMsg);
}
protected void btnSaveCountry_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtenderMsg);
}
It shows modal popup for country but not for division. But If I write
protected void btnSaveDivision_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtender1);
}
protected void btnSaveCountry_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtender1);
}
It shows modal popup neither for country nor for division. I need a common popup for each tab container. Can I do that? or what can I do here? Is there any body to help? Thanks.

Cannot read the table elements in Protractor

Trying to read the following table.
<div class="well" style="background-color: #fff;">
<table class="table table-bordered table-striped table-condensed">
<tbody><tr>
<td style="width: 20%; vertical-align: middle">
<span class="label label-primary">Field0</span>
</td>
<td>Value0</td>
</tr>
<tr>
<td style="width: 120px;">Field1</td>
<td>Value1</td>
</tr>
<tr>
<td><strong>Field2</strong></td>
<td>Value2</td>
</tr>
</tbody>
</table>
</div>
However, I am stuck when I am trying to get each of the values individually.
"return $$('.well').get(0).all(by.tagName('td')).get(0).getText();"

Posting form in JSoup doesn't produce any response

I'd like to automatically retrieve the results of searching for a Chinese character on this webpage. After inputting a character such as '馬' into the search field labelled '字形', submitting the form produces a form called 'HiddenFrom' as follows, the contents of which I'm aiming to output (which would look like the following):
<form Id="HiddenFrom" action="/yanbian/PageResult/PageResult" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post', updateTargetId: 'PageResult', onSuccess: Function.createDelegate(this, Feedback) });"><input id="ZiOrder" name="ZiOrder" type="hidden" value="" />
<input id="EudcFontChar" name="EudcFontChar" type="hidden" value="馬" />
<input id="PageNo" name="PageNo" type="hidden" value="" />
<input id="Reference" name="Reference" type="hidden" value="" />
<input id="IsZiTou" name="IsZiTou" type="hidden" value="0" />
<table border="0" cellspacing="0" cellpadding="0" width="95%" id="yanbian_result">
<tr>
<td colspan="10" align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="ZiList"><span id="StartOrder">6104</span></td>
<td><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e6%a8%99%e6%a5%b7%e9%ab%94&size=29&style=regular&color=%23000000" alt="&0.99AC;" class="charValue" style="vertical-align:text-bottom" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="10" align="right" class="Information">
共搜尋到17字,字形大小:<select name="ImageSize" id="ImageSize">
<option value="16">16</option>
<option value="20">20</option>
<option value="24">24</option>
<option value="28">28</option>
<option value="32">32</option>
<option value="36" selected="selected">36</option>
<option value="40">40</option>
<option value="44">44</option>
<option value="48">48</option>
<option value="54">54</option>
<option value="60">60</option>
<option value="66">66</option>
<option value="72">72</option>
</select>點
</td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b2&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E372;" class="charValue" style="vertical-align:text-bottom" /><br />鐵2.2(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b3&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E373;" class="charValue" style="vertical-align:text-bottom" /><br />乙9092(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%82&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E382;" class="charValue" style="vertical-align:text-bottom" /><br />甲1286(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%98&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E398;" class="charValue" style="vertical-align:text-bottom" /><br />林1.23.20(甲)<br /><td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%81&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E881;" class="charValue" style="vertical-align:text-bottom" /><br />戊寅作父丁方鼎(金)<br />商代晚期<td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%8a&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E88A;" class="charValue" style="vertical-align:text-bottom" /><br />彔伯戈冬簋蓋(金)<br />西周中期<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%b9&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8B9;" class="charValue" style="vertical-align:text-bottom" /><br />大𤔲馬簠(金)<br />春秋早期<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%bd&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BD;" class="charValue" style="vertical-align:text-bottom" /><br />伯亞臣𦉢(金)<br />春秋<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%be&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BE;" class="charValue" style="vertical-align:text-bottom" /><br />妾子𧊒壺(金)<br />戰國晚期<td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a3%80&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8C0;" class="charValue" style="vertical-align:text-bottom" /><br />燕侯載器(金)<br />戰國<td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%86%bb&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E1BB;" class="charValue" style="vertical-align:text-bottom" /><br />曾150(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%ab&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16B;" class="charValue" style="vertical-align:text-bottom" /><br />包2.30(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%af&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16F;" class="charValue" style="vertical-align:text-bottom" /><br />包2.103(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9a&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81A;" class="charValue" style="vertical-align:text-bottom" /><br />說文古文<br /><td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9b&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81B;" class="charValue" style="vertical-align:text-bottom" /><br />說文籀文<br /><td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.99AC;" class="charValue" style="vertical-align:text-bottom" /><br />說文‧馬部<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%aa%8d&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%a7%a6%e7%b3%bb%e7%b0%a1%e7%89%98%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%80&size=36&style=regular&color=%23000000" alt="&71.EA8D;" class="charValue" style="vertical-align:text-bottom" /><br />睡.雜26(秦)<br /><td><td align="center" class="VariantListA"> <td><td align="center" class="VariantListA"> <td><td align="center" class="VariantListB"> <td></tr>
<tr>
<td colspan="10" align="center" valign="top" style="border-style: solid; border-width: 1px 0px 0px 0px; border-color: #808080"> <p class="RemindMessage">(點選字形可取得字形編輯資訊)</p></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
</table>
</form>
<p class="MessageTitle" style="width: 80px">漢語大字典</p>
<dl style="width: 95%" class="control">
<dd class="size">《說文》:“馬,怒也;武也。象馬頭髦尾四足之形。<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />,古文。<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />,籀文馬與<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />同,有髦。”</dd>
</dl>
<dl style="width: 95%" class="control">
<dd style="text-align: right">字體:<a id="smallSize" class="size">小</a>.<a id="middleSize" class="size">中</a>.<a id="largeSize" class="size">大</a></dd>
</dl>
<p class="MessageTitle" style="width: 64px">相關連結</p>
<ul style="width: 95%">
<li>小學堂異體字表、小篆、金文、甲骨文、楚系簡帛文字、秦系簡牘文字、傳抄古文字</li>
<li>小學堂上古音、中古音、官話、晉語、吳語、贛語、湘語、閩語、粵語、平話、客語、其他土話</li>
<li>小學堂韻書集成、廣韻、集韻、附釋文互註禮部韻略、增修互注禮部韻略、中原音韻、中州音韻、洪武正韻</li>
<li>國際電腦漢字與異體字知識庫(含漢語大字典釋義)</li>
<li>教育部異體字字典</li>
<li>開放康熙字典</li>
<li>遠流活用中文大辭典</li>
</ul>
<p class="MessageTitle" style="width: 64px">相關索引</p>
<ul style="width: 95%">
<li>漢語大字典(遠東圖書公司),冊.頁.字:7.4539.1</li>
<li>漢語大字典(建宏出版社),頁.字:1886.17</li>
<li>康熙字典(中華書局),頁.字:1433.01</li>
<li>中文大辭典(中華學術院),冊.編號:10.45550</li>
<li>說文解字(中華書局),卷.部首:10上.馬部</li>
<li>說文解字詁林正補合編(鼎文書局),冊.頁:8.383</li>
<li>說文新證(藝文印書館),冊頁:下98</li>
<li>說文新證(福建人民出版社),頁:770</li>
<li>金文編(中華書局),頁.行:675.3</li>
<li>金文詁林(香港中文大學),卷.頁:10.1</li>
<li>金文詁林補(中央研究院),冊.卷.頁:5.10.3073</li>
<li>殷周金文集成引得(中華書局),字號.頁:3538.1060</li>
<li>新金文編(作家出版社),冊頁:中1387</li>
<li>甲骨文編(中華書局),頁.行:397.3</li>
<li>甲骨文字詁林(吉林大學),冊.頁:2.1589</li>
<li>甲骨文字集釋(中央研究院),卷.頁:10.3031</li>
<li>殷墟甲骨刻辭類纂(吉林大學),冊頁:中624</li>
<li>新甲骨文編(福建人民出版社),頁.行:539.3</li>
<li>甲骨文字編(中華書局),字號.冊頁:1928.中573</li>
<li>楚系簡帛文字編(增訂本)(湖北教育出版社),頁.行:853.2</li>
<li>睡虎地秦簡文字編(文物出版社),頁.行:153.2</li>
<li>秦簡牘文字編(福建人民出版社),頁:289</li>
<li>戰國古文字典:戰國古文聲系(中華書局),冊頁:上605</li>
<li>傳抄古文字編(綫裝書局),冊頁.行:下963.1</li>
</ul>
... However, my program only outputs the contents of the default landing page, and thus contains no mention of that form:
<td id="PageResult" align="left" valign="top" style="margin: 0px;">
<div style="width: 95%"></div>
<div id="Index">
<p class="MessageTitle" style="width: 64px">最新消息</p>
<ul style="width: 95%">
<li class="MessageList">小學堂字形演變資料庫由行政院國家科學委員會經費補助,中央研究院歷史語言研究所和資訊科學研究所共同開發,歡迎大家使用!(2013/09/25)</li>
<li class="MessageList">本資料庫共收錄字頭13098個,字形28321個。(2016/3/23)</li>
</ul>
<p class="MessageTitle" style="width: 64px">快速入門</p>
<ul style="width: 95%">
<li>適用瀏覽器:IE 8.0 以上版本、Firefox 4 以上版本、Google Chrome、Safari 5 以上版本</li>
<li>檢索條件的文字方塊內按<span class="MessagePoint">F1</span>鍵,可快速取得操作指引。</li>
<li>小學堂字形演變資料庫使用簡介。</li>
</ul>
</div> </td>
The code I've produced, based on what I can gather from other StackOverflow posts, is as follows. It successfully connects to the page, but either the post fails or the results aren't being read correctly:
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.FormElement;
import org.jsoup.select.Elements;
import java.io.IOException;
public class ImgURLExtractor {
public void sendPostAndPrintResponse(String kanjiToSearch) throws IOException {
Document doc = Jsoup.connect("http://xiaoxue.iis.sinica.edu.tw/yanbian")
.data("ZiOrder", "") // The 'ZiOrder' form field can be left blank.
.data("EudcFontChar", kanjiToSearch)
// 'EudcFontChar' is the id of the search field I want to enter my query '馬' into.
.method(Connection.Method.POST)
.post();
Elements target = doc.select("#PageResult");
// The table row '#PageResult' should contain the 'HiddenFrom' form.
System.out.println(target.toString());
}
public static void main(String[] args) throws IOException {
ImgURLExtractor example = new ImgURLExtractor();
example.sendPostAndPrintResponse("馬");
}
}
Thanks if anyone can help.
Looking at the Network tab of Chrome's Developer Tools (or Firefox) you can examine the exact request that is sent to the server. The response from the server is what you are looking for.
Here is a snapshot of the Dev Tools: (you can see the POST request URL and also the data being sent)
So all you need to do is to imitate sending this request to the server and get what you need in the response.
Here is a sample Java code for sending a POST request using OkHttp library:
package com.sample;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class PostExample {
private static final MediaType FORM = MediaType.parse("application/x-www-form-urlencoded; charset=UTF-8");
private OkHttpClient client = new OkHttpClient();
private String post(String url, String formData) throws IOException {
RequestBody body = RequestBody.create(FORM, formData);
Request request = new Request.Builder().url(url).post(body).build();
Response response = client.newCall(request).execute();
return response.body().string();
}
private String createFormData(String ziOrder, String eudcFontChar) throws UnsupportedEncodingException {
return "ZiOrder=" + URLEncoder.encode(ziOrder, "UTF-8") +
"&EudcFontChar=" + URLEncoder.encode(eudcFontChar, "UTF-8") +
"&ImageSize=36&X-Requested-With=XMLHttpRequest";
}
public static void main(String[] args) throws IOException {
PostExample example = new PostExample();
String formData = example.createFormData("", THE_CHINESE_CHAR);
String response = example.post("http://xiaoxue.iis.sinica.edu.tw/yanbian/PageResult/PageResult", formData);
System.out.println(response);
}
}
Running this code will return the HiddenFrom:
<form Id="HiddenFrom"...
Thanks to Navid (above) putting me back on the right track with his OkHttp code (showing that I should point to the PageResult/PageResult directory instead of the root), and finding an example usage of the 'org.jsoup.Connection.Response' class, I was able to also get the program working in JSoup. Here it is for reference:
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.Connection.Response;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.FormElement;
import org.jsoup.select.Elements;
import java.io.IOException;
public class ImgURLExtractor {
public void sendPostAndPrintResponse(String kanjiToSearch) throws IOException {
Response response = Jsoup.connect("http://xiaoxue.iis.sinica.edu.tw/yanbian/PageResult/PageResult")
.data("ZiOrder", "")
.data("EudcFontChar", kanjiToSearch)
.data("ImageSize", "36")
.data("X-Requested-With", "XMLHTTPRequest")
.method(Connection.Method.POST)
.timeout(10000) // This website can actually take a while to respond
.execute();
System.out.println(response.parse());
// Payload should include: /ImageText2/ShowImage.ashx?text=&font=中研院甲骨文重文三&size=36&style=regular&color=%23000000
}
public static void main(String[] args) throws IOException {
ImgURLExtractor example = new ImgURLExtractor();
example.sendPostAndPrintResponse("馬");
}
}
It returns:
<html>
<head></head>
<body>
<form id="HiddenFrom" action="/yanbian/PageResult/PageResult" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post', updateTargetId: 'PageResult', onSuccess: Function.createDelegate(this, Feedback) });">
<input id="ZiOrder" name="ZiOrder" type="hidden" value="">
<input id="EudcFontChar" name="EudcFontChar" type="hidden" value="馬">
<input id="PageNo" name="PageNo" type="hidden" value="">
<input id="Reference" name="Reference" type="hidden" value="">
<input id="IsZiTou" name="IsZiTou" type="hidden" value="0">
<table border="0" cellspacing="0" cellpadding="0" width="95%" id="yanbian_result">
<tbody>
<tr>
<td colspan="10" align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="ZiList"><span id="StartOrder">6104</span></td>
<td><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e6%a8%99%e6%a5%b7%e9%ab%94&size=29&style=regular&color=%23000000" alt="&0.99AC;" class="charValue" style="vertical-align:text-bottom"></td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td colspan="10" align="right" class="Information"> 共搜尋到17字,字形大小:<select name="ImageSize" id="ImageSize"> <option value="16">16</option> <option value="20">20</option> <option value="24">24</option> <option value="28">28</option> <option value="32">32</option> <option value="36" selected>36</option> <option value="40">40</option> <option value="44">44</option> <option value="48">48</option> <option value="54">54</option> <option value="60">60</option> <option value="66">66</option> <option value="72">72</option> </select>點 </td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b2&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E372;" class="charValue" style="vertical-align:text-bottom"><br>鐵2.2(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b3&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E373;" class="charValue" style="vertical-align:text-bottom"><br>乙9092(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%82&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E382;" class="charValue" style="vertical-align:text-bottom"><br>甲1286(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%98&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E398;" class="charValue" style="vertical-align:text-bottom"><br>林1.23.20(甲)<br></td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%81&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E881;" class="charValue" style="vertical-align:text-bottom"><br>戊寅作父丁方鼎(金)<br>商代晚期</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%8a&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E88A;" class="charValue" style="vertical-align:text-bottom"><br>彔伯戈冬簋蓋(金)<br>西周中期</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%b9&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8B9;" class="charValue" style="vertical-align:text-bottom"><br>大𤔲馬簠(金)<br>春秋早期</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%bd&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BD;" class="charValue" style="vertical-align:text-bottom"><br>伯亞臣𦉢(金)<br>春秋</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%be&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BE;" class="charValue" style="vertical-align:text-bottom"><br>妾子𧊒壺(金)<br>戰國晚期</td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a3%80&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8C0;" class="charValue" style="vertical-align:text-bottom"><br>燕侯載器(金)<br>戰國</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%86%bb&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E1BB;" class="charValue" style="vertical-align:text-bottom"><br>曾150(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%ab&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16B;" class="charValue" style="vertical-align:text-bottom"><br>包2.30(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%af&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16F;" class="charValue" style="vertical-align:text-bottom"><br>包2.103(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9a&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81A;" class="charValue" style="vertical-align:text-bottom"><br>說文古文<br></td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9b&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81B;" class="charValue" style="vertical-align:text-bottom"><br>說文籀文<br></td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.99AC;" class="charValue" style="vertical-align:text-bottom"><br>說文‧馬部<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%aa%8d&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%a7%a6%e7%b3%bb%e7%b0%a1%e7%89%98%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%80&size=36&style=regular&color=%23000000" alt="&71.EA8D;" class="charValue" style="vertical-align:text-bottom"><br>睡.雜26(秦)<br></td>
<td></td>
<td align="center" class="VariantListA"> </td>
<td></td>
<td align="center" class="VariantListA"> </td>
<td></td>
<td align="center" class="VariantListB"> </td>
<td></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top" style="border-style: solid; border-width: 1px 0px 0px 0px; border-color: #808080"> <p class="RemindMessage">(點選字形可取得字形編輯資訊)</p></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
</tbody>
</table>
</form>
<p class="MessageTitle" style="width: 80px">漢語大字典</p>
<dl style="width: 95%" class="control">
<dd class="size">
《說文》:“馬,怒也;武也。象馬頭髦尾四足之形。
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">,古文。
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">,籀文馬與
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">同,有髦。”
</dd>
</dl>
<dl style="width: 95%" class="control">
<dd style="text-align: right">
字體:
<a id="smallSize" class="size">小</a>.
<a id="middleSize" class="size">中</a>.
<a id="largeSize" class="size">大</a>
</dd>
</dl>
<p class="MessageTitle" style="width: 64px">相關連結</p>
<ul style="width: 95%">
<li>小學堂異體字表、小篆、金文、甲骨文、楚系簡帛文字、秦系簡牘文字、傳抄古文字</li>
<li>小學堂上古音、中古音、官話、晉語、吳語、贛語、湘語、閩語、粵語、平話、客語、其他土話</li>
<li>小學堂韻書集成、廣韻、集韻、附釋文互註禮部韻略、增修互注禮部韻略、中原音韻、中州音韻、洪武正韻</li>
<li>國際電腦漢字與異體字知識庫(含漢語大字典釋義)</li>
<li>教育部異體字字典</li>
<li>開放康熙字典</li>
<li>遠流活用中文大辭典</li>
</ul>
<p class="MessageTitle" style="width: 64px">相關索引</p>
<ul style="width: 95%">
<li>漢語大字典(遠東圖書公司),冊.頁.字:7.4539.1</li>
<li>漢語大字典(建宏出版社),頁.字:1886.17</li>
<li>康熙字典(中華書局),頁.字:1433.01</li>
<li>中文大辭典(中華學術院),冊.編號:10.45550</li>
<li>說文解字(中華書局),卷.部首:10上.馬部</li>
<li>說文解字詁林正補合編(鼎文書局),冊.頁:8.383</li>
<li>說文新證(藝文印書館),冊頁:下98</li>
<li>說文新證(福建人民出版社),頁:770</li>
<li>金文編(中華書局),頁.行:675.3</li>
<li>金文詁林(香港中文大學),卷.頁:10.1</li>
<li>金文詁林補(中央研究院),冊.卷.頁:5.10.3073</li>
<li>殷周金文集成引得(中華書局),字號.頁:3538.1060</li>
<li>新金文編(作家出版社),冊頁:中1387</li>
<li>甲骨文編(中華書局),頁.行:397.3</li>
<li>甲骨文字詁林(吉林大學),冊.頁:2.1589</li>
<li>甲骨文字集釋(中央研究院),卷.頁:10.3031</li>
<li>殷墟甲骨刻辭類纂(吉林大學),冊頁:中624</li>
<li>新甲骨文編(福建人民出版社),頁.行:539.3</li>
<li>甲骨文字編(中華書局),字號.冊頁:1928.中573</li>
<li>楚系簡帛文字編(增訂本)(湖北教育出版社),頁.行:853.2</li>
<li>睡虎地秦簡文字編(文物出版社),頁.行:153.2</li>
<li>秦簡牘文字編(福建人民出版社),頁:289</li>
<li>戰國古文字典:戰國古文聲系(中華書局),冊頁:上605</li>
<li>傳抄古文字編(綫裝書局),冊頁.行:下963.1</li>
</ul>
</body>
</html>
Process finished with exit code 0

Accordion inside another accordion

Iam using ajax accordion. Is it possible to add an ajax accordion inside another accordion.
I tried adding this, but the accordion inside is not loading(not getting displayed)
<ajax:Accordion ID="accordionCountry" HeaderCssClass="headerStyle marginUpDown" HeaderSelectedCssClass="headerSelectedStyle" ContentCssClass="contentBackground" runat="server" SelectedIndex="-1" FadeTransitions="true" SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="false" AutoSize="None">
<HeaderTemplate>
<asp:Panel ID="pnlShowCategory" runat="server" CssClass="cursorPointer categoryPanelBackground marginUpDown">
<table cellpadding="0" cellspacing="0" width="98%">
<tr>
<td align="left">
<asp:Label ID="lblCategoryName" runat="server" Text='<%# Eval("CategoryName") %>'
CssClass="paddingLeft"></asp:Label>
</td>
<td align="right">
<asp:Image ID="Image3" runat="server" ImageAlign="Right" Height="20px" CssClass="verticalAlignMiddle" />
<asp:HiddenField ID="hdnCategoryId" runat="server" Value='<%# Eval("CategoryId") %>' />
</td>
</tr>
</table>
</asp:Panel>
</HeaderTemplate>
<ContentTemplate>
<ajax:Accordion ID="accordionCountry1" HeaderCssClass="headerStyle marginUpDown" HeaderSelectedCssClass="headerSelectedStyle"
ContentCssClass="contentBackground" runat="server" SelectedIndex="-1" FadeTransitions="true"
SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40"
RequireOpenedPane="false" AutoSize="None">
<HeaderTemplate>
</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="pnl" runat="server" CssClass="cursorPointer categoryPanelBackground marginUpDown">
<table cellpadding="0" cellspacing="0" width="98%">
<tr>
<td align="left">
<asp:Label ID="lblSubCategoryName" runat="server" Text='<%# Eval("SubCategoryName") %>'
CssClass="paddingLeft"></asp:Label>
</td>
<td align="right">
<asp:Image ID="Image3" runat="server" ImageAlign="Right" Height="20px" CssClass="verticalAlignMiddle" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</ajax:Accordion>
</ContentTemplate>
</ajax:Accordion>
try to use jQuery for accordion, it's better, check below link out :
click run after you click the link below
(function($) {
var allPanels = $('.accordion .dd').hide();
$('.accordion .dt a').click(function() {
allPanels.slideUp();
$(this).parent().next().slideDown();
return false;
});
})(jQuery);
Check This

Jquery parent child selectors

I have the html structure below and I'm trying to select the row containing the text 'Related list item:'.
My Jquery is below:
$('#WebPartWPQ3 > table(eq:2) > tbody > tr > td > table > tbody > tr:last').remove();
but not working...
<DIV id="WebPartWPQ3" fixed_bound allowDelete="false" OnlyForMePart="true" HasPers="true" WebPartID="00000000-0000-0000-0000-000000000000" width="100%">
<TABLE cellSpacing="0" cellPadding="4" width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-vb" fixed_bound>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD fixed_bound>
<TABLE cellSpacing="0" width="100%" border="0" fixed_bound>
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-formlabel" vAlign="top" noWrap width="25%" fixed_bound>
<B fixed_bound>Title:
</B>
</TD>
<TD class="ms-formbody" vAlign="top" width="75%" fixed_bound>Employee annual leave approval
<BR fixed_bound/>
<BR fixed_bound/>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" width="25%" fixed_bound>
<B fixed_bound>Approved Carry Forward days
<SPAN class="ms-formvalidation" fixed_bound> *
</SPAN>:
</B>
</TD>
<TD class="ms-formbody" width="75%" fixed_bound>
<SPAN fixed_bound>
<INPUT class="ms-input" id="ctl00_PlaceHolderMain_TaskForm_ff1_1_ctl00_ctl00_TextField" title="Approved Carry Forward days" style="IME-MODE: inactive" size="11" name="ctl00$PlaceHolderMain$TaskForm$ff1_1$ctl00$ctl00$TextField" fixed_bound value=""/>
<BR fixed_bound/>
</SPAN>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" width="25%" fixed_bound>
<B fixed_bound>Review Comments:
</B>
</TD>
<TD class="ms-formbody" width="75%" fixed_bound>
<SPAN fixed_bound>
<TEXTAREA class="ms-long" id="ctl00_PlaceHolderMain_TaskForm_ff2_1_ctl00_ctl00_TextField" title="Review Comments" name="ctl00$PlaceHolderMain$TaskForm$ff2_1$ctl00$ctl00$TextField" rows="5" fixed_bound>
</TEXTAREA>
<BR fixed_bound/>
</SPAN>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" vAlign="top" noWrap width="25%" fixed_bound>
<B fixed_bound>Related list item:
</B>
</TD>
<TD class="ms-formbody" vAlign="top" width="75%" fixed_bound>
<A href="http://orange.extra.net/people/hr/Workflows/Expire%20the%20employee%20year%20in%20a%20year/" fixed_bound>
</A>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing="0" cellPadding="4" width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-vb" noWrap fixed_bound>
<INPUT style="DISPLAY: none" onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__update;__commit;__redirectsource;__redirectToList={};')" type="button" name="btnSave" fixed_bound jQuery1291028280448="3" value="Save Draft"/>
</TD>
<TD fixed_bound>
<INPUT onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__update;__workflowTaskComplete={0*};__commit;__redirectsource;__redirectToList={};')" type="button" name="btnMarkSubmited" fixed_bound value="Complete Task"/>
</TD>
<TD class="ms-vb" noWrap width="99%" fixed_bound>
<INPUT onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__cancel;__redirectsource;__redirectToList={};')" type="button" name="btnCancel" fixed_bound value="Cancel"/>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
$('.ms-formlabel').last().children().remove();
I prefer to give an id to the tr and remove the tr by id.
$('#trid').remove();
$('#WebPartWPQ3').find('Related list item').closest('tr').remove();