简体   繁体   中英

Display a scrolling message that can be updates by another webpage

I'm looking for a solution to this and I have searched the web for an answer with nothing. I need a scrolling message on my webpage that can be updated by the same website but on a different page. (eg www.webpage.com <-- has the scrolling message on it, www.webpage.com/settings <-- has a form in which you can change/update the scrolling message)

I'm pretty sure this is achievable with Java, but my knowledge on Java is slim and all my efforts have come to a fail. I have managed to get a scrolling message on my webpage and I'm sure if I could read a text file (with the message in) then assign that to a 'var', I could make that scroll but I don't know how to do that.

If you know a completely different method of doing this I am happy to change mine.

Thanks in advance, Tom.

I would recommend javascript instead of java, since java is not really conventional anymore and looks ugly too (and requires a special plugin).

It depends on how fast you want to update the scrolling text how you want to do this. I would say save the text to a .txt or database from settings, and then have your page get it.

You can then use php to read the value from the .txt file or database to display it on your website.

If you want it to be extremely up to date you can let javasript call a little .php file that reads the file and gives you the content.

To make your text scroll you don't really need anything other than html, like so:

<marquee behavior="scroll" direction="left">Your scrolling text goes here</marquee>

You can read more about that here: http://www.quackit.com/html/codes/scrolling_text.cfm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM