0

In my JSP file there is a custom tag <table:page page="${page}"></table:page> .

I want to update value of ${page} by ajax.

Now ajax return a successful value.

The returned value seems like <div><ul><li></li></ul><div>,

But I have an idea that how can I get this custom tag and set html to it ?

In tag file it is like this <%@ attribute name="page" type="com.common.Page" required="true"%>

I tried many ways, but it doesn`t work.

Any suggestion is welcome.

Wendy
  • 73
  • 2
  • 15

1 Answers1

1

document.getElementsByTagName('table:page') will retrieve the HtmlCollection you desire.

Alexandru Cojan
  • 186
  • 2
  • 2
  • But I tried alert(document.getElementsByTagName('table:page').innerHTML); It is undefined – Wendy Jun 29 '16 at 07:57
  • Sorry for the late answer - it returns a HtmlCollection and you can iterate through it. (see here how: http://stackoverflow.com/questions/22754315/foreach-loop-for-htmlcollection-elements) – Alexandru Cojan Jul 14 '16 at 14:45