ID:162251
 
I added a browser and such into my interface, and using my old topics (Cause I hate HTML) I got it working fine, but I have one question I dont remember ever asking, and don't find it in the Search.

Is there a way to refresh the browser so that the text only shows what is the most-recently added text (By my desgression)? What I mean is that I have like
HP
MP
EXP
For example show up on my browser, and I have it constantly refresh while this stats become changed. Therefore, without it refreshing, it will bundle up and make a gigantic scroll bar and such that will not be good or pretty. Is there a way to make it clear all text prior to a certain text that is coming after? Like at the beginning of the code, I do a clear?
while(1)
var/html={"
HP:
[HP]/[maxHP]
MP:
[MP]/[maxMP]
EXP:
[EXP]/[maxEXP]
"}

src<<browse(html)
sleep(10)

That should get the main point across, it refreshes the browser every 1 second. Remember that only 1 browser exists and if you browse something else, it will get overwritten. If you have multiple browsers, I suggest having a default one where you send normal browse()s to and send the constantly refreshing browse()s to a different browser control.
In response to Kakashi24142
You know what I just realized about a second ago? It seems that I have it refresh fine where I put it. I forgot that I put it in a part that deals with my HP and MP already to draw it in the first place, so it updates whenever my health or mp are different from original anyway.

Actually, I have a different problem that kinda annoys me. When it refreshes, I get a scrollbar at the side of the panel, right next to my map. Is there a way to have it delete any prior text when it refreshes (I think thats the problem) or a way to disable the scrollbar (Like make it invisible)?
In response to Polantaris
That question you have to ask the BYOND Staff. I don't recall feature allowing you to disable the scrollbar, sorry.
In response to Kakashi24142
No problem. If I could move where it was I could just stuff it off the screen...or I could stuff it under the map...hmm...
In response to Polantaris
I'm not sure if this could work the same with a browser, but I had the same problem but with an output window. All you need to do is clear the data before the new data is shown:
src<<output(null)

The null would erase everything. Hope this helps.
In response to DisturbedSixx
Ah exactly what I wanted =) THanks.

Edit: It worked perfectly. I suspected the problem was something like extra blank lines causing it to create a scrollbar, thanks again.
1) BYOND Staff is working on AJAX support, allowing you to refresh parts of the browser (like the HP/MP/EXP fields) manually, instead of having to refresh the entire thing.

2) The scrollbar appearing is a known bug in IE. It appears when you refresh the page and I haven't found a way to get rid of it with any "blank spaces" as you're saying. (It even appears when you just hit "F5" on the page!)

To get rid of the scrollbar you can send some CSS:
body { overflow: hidden; }
will hide the scrollbar: if there is actually anything to scroll it will still allow you to scroll!

-- Data
In response to Android Data
Oh awesome, that sounds great.

The scrollbar just destroys my interface if you see it, ugly ugly when everything else is black/grey.
In response to Polantaris
Polantaris wrote:
The scrollbar just destroys my interface if you see it, ugly ugly when everything else is black/grey.

In the browser element, assuming BYOND never switches from IE to Gecko or another implementation, allows you to change the colors of the statusbar due to a feature in IE not included in any other browsers. I find it sad that people complain about this feature and refuse to put it in other browsers just because said browsers are supposed to be "better" than IE, yet at the same time they don't provide handy features like changing scrollbar colors like IE does.

-- Data
In response to Android Data
How? I'm in my browser settings and I dont see anything about colors at all.