Altering HTML Text

Dave Cragg dave.cragg at lacscentre.co.uk
Wed Feb 24 02:34:19 CST 2010


Ray

I was able to add a line and redisplay it (almost) by doing something like this:

   put revBrowserGet(gBrowserD, "htmltext") into tHtmlText
   replace "</BODY>" with "<p>Extra line</p></BODY>" in tHtmlText
   # put empty into char 1 to 3 of tHtmlText  ## not necessary it seems (removing the utf-8 BOM mark at the beginning)
   put uniDecode(uniEncode(tHtmlText, "UTF8")) into tHtmlText
   revBrowserSet gBrowserD, "htmltext", tHtmlText

I said "almost" because there's a problem with the image in the html. It uses a relative url (../images/5067210.Jpeg). When you use revBrowserSet to set the htmltext property, the base url is no longer the same as when loaded directly from the server. So some more manipulation of the image src urls would be needed.

I notice that the html has the "head" element inside the "body" element. Although my browser seems happy with that (Safari), it doesn't seem right.

Cheers
Dave


On 23 Feb 2010, at 21:31, Ray Horsley wrote:

> If I use the RevBrowser library handlers to display it in an image I can then get the htmlText of the 'instance' using the RevBrowserGet() function.  That's where I get strange looking characters.  If I then set the htmlText of the same image using RevBrowserSet, passing the return I got from RevBrowserGet(), the display turns weird.  I'll include, below, a little bit of the weird return I get from the RevBrowserGet() function after displaying the above URL.
> 
> Thanks,
> 
> Ray
> 
> <HTML><BODY><HEAD></HEAD><div style="font-size:14pt; font-family: Times; font-weight: bold;text-align:center;"><span style="font-size:14pt; font-family: Times; font-weight: bold;text-align:center;">Arrowhead Farm</span></div><div style="text-align:center;margin-top:0pt;margin-bottom: 1em;"><img src="../images/5067210.Jpeg" width="70" height="191" format="Jpeg" /></div><table style="font-size:12pt; font-family: Times; font-weight: normal;"><tr><td style="font-size:12pt; font-family: Times; font-weight: normal;vertical-align: top; width: .25in;">1</td><td><div style="text-indent: 0.25in;margin-top:0em;margin-bottom:1em;">“Hey, Max, time to wake up,” Mrs. Jensen said. “It’s Saturday, our day to visit Grandpa.”</div></td></tr></table><table style="font-size:12pt; font-family: Times; font-weight: normal;"><tr><td style="font-size:12pt; font-family: Times; font-weight: normal;vertical-align: top; width: .25in;">2</td><td><div style="text-indent: 0.25in;margin-top:0em;margin-bottom:1em;">




More information about the use-livecode mailing list