MyBB Community Forums

Full Version: BBCode versus AJAX/AJAP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all
i had made a bbcode filter which uses the input between the tags to catch some data from an external source, spice it up a bit and output it...

now i have a thread where this tag is used about 25 times, taking some considerable time to catch all the data from external sources, until the page has finally loaded and is displayed...

so i thought about doing some ajax/ajap thing with that bbcode tag to let the page load quickly and let javascript do the rest (although i'd still want to use my old php function in that)...

has anyone made some experiences with that already, any hints ?
The problem with that solution is... if the end user disables Javascript.

How about rethink your design a bit?
One solution could be to put the post into a queue, where the server parses it without users waiting for page loads.
If you don't like having the post not show up, you could display the post, then get the server to insert the various elements when it gets around to processing them.
and how am i to delay the processing of the stuff without javascript?

http://www.tm-creative.org/forum/thread-930.html
this is the page..
it catches lots of stuff from an external source, then displays it..

maybe you can elaborate on what you think of
Something like:
Insert Post without parsing -> create separate worker thread (or process) to parse content.

How you create the separate thread is up to you. You could use a cron, or use the task system, or you could exec some application to do it for you.


It's not easy however.
oh i understand..so the idea is to let some seperate process replace the catch-on-the-fly BBcode thing with something that converts the bbcode to permanent content..

i dont think that is flexible enough, since the catched data from outside could always change again. i would really prefer an on-the-fly thing.. i mean, there's no real reason not to do it with javascript, is there? if someone has turned it off, he'll get a message in the window to activate it :ß
Some things are just not logically sound, but if that's what you want, they you could use an AJAX loader to do so.