Create a javascript function

W Toku Opublikowano Aug 13, 2014 Płatność przy odbiorze
W Toku Płatność przy odbiorze

Need a routine written in pure Javascript (please no jquery or other addons).

No reliance on server side processing, all in browser please.

Remove all duplicate and extra tags.

Handle attributes as well as tags.

Adjust an array of character positions after tag removal.

In this text, character position 50 is the H in Hello

Character position 100 is the T in There.

Example of functions usage:

var messyhtmlstring = "<font face='arial'><b><b><font face='times'><i><b>Hello</b></b></i><i><font face='arial'></font><b> There</b></i></font><font face='times'>.<br></font></b></font>"

var posadjust = [ 50, 100 ];

var cleanedhtmlstring = StrHTMLClean(messyhtmlstring, posadjust);

Clean result should be:

"<b><font face='times'><i>Hello There</i>.<br></font></b>"

Adjusted positions should be:

posadjust = [ 25, 31 ]

var posadjust is the position of the text Hello and There.

So that would be needed for each word in the html output.

It must be quick since it's going to be constantly called during editing.

JavaScript

Numer ID Projektu: #6316819

O projekcie

10 ofert Zdalny projekt Aktywny Aug 13, 2014

Przyznany użytkownikowi:

rubytopcoders

Hello, I am expert with Javascript and i am very interesting this project! Hope to work with you! Best regards, LEO

£55 GBP w ciągu 3 dni
(1 Ocena)
2.2

10 freelancerów złożyło ofertę za £127 w tym projekcie

sheikhabuzer

I have been working as a Web Developer... I have created differnt websites using HTML5,CSS3,Javascript,Jquery,BootStrap,AngularJS,PHP,Wordpress etc... I can do this quickly... Here are few projects... https://w Więcej

£23 GBP w ciągu 0 dni
(76 Oceny)
7.6
samitXI

Hi Sir, I am ready to work for you.I have 9 years of experience in C/C++, python , java, PHP, Javascript and, MySQL. please see some of my works also check my reviews you will get better idea about my skill.I deliver Więcej

£222 GBP w ciągu 5 dni
(23 Oceny)
6.2
TrickyWebtech

HI,Me as web expert.I have expertise in javascript and jquery.I understood your requirement and if you allow me then I can work on your project and complete today.

£92 GBP w ciągu 0 dni
(43 Oceny)
6.1
audelk

im expert in javascript. i can do this without a glitch. ------------------------------------------------------------------------ thank you audel

£66 GBP w ciągu 5 dni
(22 Oceny)
5.7
lucentinnovation

Greeting from Lucent Innovation...!!! Hello there, I am Javascript dev here. you can hire us with good out put. We can discuss more on this. Many Thanks Nitesh Lucent Innovation

£184 GBP w ciągu 3 dni
(10 Oceny)
3.7
sujoymondal87

A proposal has not yet been provided

£116 GBP w ciągu 2 dni
(6 Oceny)
3.2