Spaces before/after with data passing to Ajax...

Spaces before/after with data passing to Ajax...

mschumacher777mschumacher777 Posts: 8Questions: 6Answers: 1
edited July 2016 in Free community support

With this snip of detail row in the DataTable, I'm pulling values from the table and sending through a ajax request with params. This TD row results in many spaces getting put prior and after the "Otherwise" part when executed. I'm confused as to why there is extra spaces within the passing of the value?

Sorry, I don't have a working example at this point.

<td>
  <c:choose>
    <c:when test="${hasAccess}">
      <c:url var="detailLink" value="/detail.do">
        <c:param name="code" value="${searchForm.cCode}"/>
        <c:param name="uni" value="${searchForm.uni}"/>
        <c:param name="searchType" value="${searchForm.searchType}"/>
        <c:param name="startDate" value="${searchForm.startDate}"/>
        <c:param name="endDate" value="${searchForm.endDate}"/>
      </c:url>
      <a href="<c:out value="${detailLink}"/>"><c:out value="${searchForm.number}"/></a>
    </c:when>
    <c:otherwise>
      <c:out value="${searchForm.number}"/>
    </c:otherwise>
  </c:choose>
</td>

GET /wrd/testAjax.do?code=12345&uni=761786&number=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%203WH8SK2%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 HTTP/1.1

This is the section of code that retrieves the "number" above.

 // Comment to move things down
 var params = "code=" + row.data().code + "&uni=" + row.data().uni + "&number=" + row.data().number;
 var schuresults = "";
 $.ajax({url: "/wrd/testAjax.do",
     data: params,
     success: function(result) {
     row.child(format(result)).show();

Answers

  • allanallan Posts: 62,327Questions: 1Answers: 10,227 Site admin

    If you disable DataTables does the problem go away? I don't know of any reason why DataTables would cause this.

    Allan

This discussion has been closed.