I have html web page and i want to download this web page as pdf. So that i convert this web page to string, and i must sent to the service. Namely i have unchanging string html. I can't add indicator for split string html. When the html web page too large with base 64 string images, i must change this base 64 string with avatar image url (Because it is too large to send data with json). i have short html string with changing base 64 string and then i can send to the service side to download pdf. I have an HTML string (it looks like my real html string) see below:
var stringHTML =
"
<div id="myDiv">
<img src="abc" /></div>
<img src="abc" /></div>
<img src="abc" /></div>
<img src="abc" /></div>
</div>
";
I want to change image src
attribute value to xyz
. Namely I want to convert the HTML string to:
stringHTML =
"
<div id="myDiv">
<img src="xyz" /></div>
<img src="xyz" /></div>
<img src="xyz" /></div>
<img src="xyz" /></div>
</div>
";
How can change this source attribute values with return again string value ? Namely i must have string html after change operation..