# javascript in views other then html - add position information to span elements

**URL:** <https://support.prodi.gy/t/javascript-in-views-other-then-html-add-position-information-to-span-elements/935>\
**Category:** Uncategorized\
**Tags:** enhancement, done, custom, front-end\
**Created:** [November 4, 2018, 8:52pm UTC](https://support.prodi.gy/t/javascript-in-views-other-then-html-add-position-information-to-span-elements/935 "2018-11-04T20:52:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [November 5, 2018, 11:23am UTC](https://support.prodi.gy/t/javascript-in-views-other-then-html-add-position-information-to-span-elements/935/2 "2018-11-05T11:23:44Z")

</div>

Thanks for sharing your use case! Just to make sure I understand what you're trying to do, could you share an example of the data you want to feed in?

And is there any way you can do more preprocessing on the server side to extract only the text you're looking for, annotate that in smaller chunks in the manual interface and then put it back together based on the character positions and meta? This means you won't have to rely on _both_ the front-end and back-end to do data transformation, which introduces a much higher error potential and risks if they're out-of-sync.

Btw, I also discuss some of the difficulties with using manual interfaces and formatted content [in this thread](https://support.prodi.gy/t/using-ner-manual-on-html-input/876/2), which might be relevant. Although, it sounds like you already have a good plan for how to solve all of this.

> [@pat](#):
>
> Edit: as with #2 und #3 i have just noticed that the spans lose their id after annotation 😕 that could possible be a problem with my approach.

Do you mean pre-defined spans in the input data? If so, it's possible that the manual interface currently doesn't retain custom metadata on spans, as it assumes they'll be added/removed/edited anyways. But I'll need to double-check this!

> [@pat](#):
>
> But how could i access the task meta data in my own script as its not exposed like in window.prodigy (or is there a way to access it? - in ner\_manual UI)

This is a good point – I definitely want to make all interfaces expose the task data and callbacks if custom JavaScript is enabled, and also allow executing custom scripts across interfaces.

---

_[View the full topic](https://support.prodi.gy/t/javascript-in-views-other-then-html-add-position-information-to-span-elements/935)._
