MyBB Community Forums

Full Version: Ajax Preview Post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
AJAX reduces the number of page reloads. The user sees the same page but some of the data on it changes. Trust me - the only way AJAX is going to go away is if HTML6 introduces something better. There aren't enough hours in the day for me to keep caught up with the demands I have now for web apps (I do this for a living). Without AJAX? I'd retire. I haven't written a non-Ajaxian app in at least a couple of years, except for little test pages. (And none at all if you include FirePHP as AJAX - my bare PHP template includes FirePHP.)

No problem with JS, unless you're running IE 5.5. It keeps getting better with each version of IE, and even 8 does a fairly decent job. And I push it almost to the limit. (Granted, filling a grid with 1,000 rows in 5.5 meant going out for a nice long lunch before IE finished rendering the grid.)

Not every browser supports the same features in CSS or HTML, so we have to go back to a fully-textual web (yes, the web was originally hypertext). Or we can write code that's pretty cross-browser compatible. Don't blame the language, or the interpreter, for problems caused by "programmers" who don't actually know what they're doing.

BTW, sending a request to the server, then changing the value or innerHTML on a text or div, is totally cross-browser compatible. You'll find it next to "totally trivial" in the dictionary.
(2011-10-20, 12:33 PM)Rukbat Wrote: [ -> ]AJAX reduces the number of page reloads. The user sees the same page but some of the data on it changes.

By that logic, all websites carrying a similar page layout should be fully AJAX-based. And no, I don't see that as ideal.

Quote:No problem with JS, unless you're running IE 5.5. It keeps getting better with each version of IE, and even 8 does a fairly decent job. And I push it almost to the limit.

Keep in mind that you also have to deal with mobile browsers, which have hiccups.

Quote:Don't blame the language, or the interpreter, for problems caused by "programmers" who don't actually know what they're doing.

JavaScript is a rather fussy scripting language to work with in the first place. Sometimes things work, other times they don't (often for inexplicable reasons, such as the random unchecking of the sticky option in MyBB - see the SVN bug report for more info). I haven't taken the time to learn JS so that just adds fuel to the fire. The other issue I have is you're now involving even more code to accomplish the same task (not line count-wise, but PHP/HTML/CSS/JS as opposed to PHP/HTML/CSS). The fact is, most things don't need to use AJAX to operate efficiently.

That being said, I'm not sure I like where web design is going - rounded corners everywhere, stupid little fading effects on everything, etc. Unfortunately I view javascript as a part of this "problem". It's left a pretty bad taste in my mouth.
(2011-10-20, 10:05 PM)Scoutie44 Wrote: [ -> ]
(2011-10-20, 12:33 PM)Rukbat Wrote: [ -> ]AJAX reduces the number of page reloads. The user sees the same page but some of the data on it changes.

By that logic, all websites carrying a similar page layout should be fully AJAX-based. And no, I don't see that as ideal.
Neither do I - for pages that don't need it. But for some, you either refresh a whole large page, or you sent the page a small amount of data and the page puts it where it goes.

Quote:
Quote:No problem with JS, unless you're running IE 5.5. It keeps getting better with each version of IE, and even 8 does a fairly decent job. And I push it almost to the limit.

Keep in mind that you also have to deal with mobile browsers, which have hiccups.

My philosophy - and I'm fortunate in that I can work using it - is that I'm not a company that writes browsers, so I don't fix their bugs. I write W3C-validated pages, and if the browsers aren't written to the standard, that's not my problem.

Quote:JavaScript is a rather fussy scripting language to work with in the first place. Sometimes things work, other times they don't (often for inexplicable reasons, such as the random unchecking of the sticky option in MyBB - see the SVN bug report for more info). I haven't taken the time to learn JS so that just adds fuel to the fire.

Oh, please. You're blaming a lack of ability to use a tool on the tool. JS isn't "fussy" and when things don't work it's because the code is written wrong (or the browser's ECMA-script interpreter is).

Quote:The other issue I have is you're now involving even more code to accomplish the same task (not line count-wise, but PHP/HTML/CSS/JS as opposed to PHP/HTML/CSS).

Sorry, no. You're not going to write a very heavy database app (I'm not talking about something lite like a forum, but an app that's the front end for a large [millions of records] database without a lot of JS. Using XML or JSON to communicate back and forth (that's what AJAX is) actually reduces code - and makes for a more pleasant experience for the user. I'm not going back to the 1990 web. No professional would.

Quote:The fact is, most things don't need to use AJAX to operate efficiently.
The fact is that almost everything I write does. And, since I'm writing about 3 full apps a week, every single week, I think I have a slight knowledge of the subject.

Quote:That being said, I'm not sure I like where web design is going - rounded corners everywhere, stupid little fading effects on everything, etc. Unfortunately I view javascript as a part of this "problem". It's left a pretty bad taste in my mouth.
Again, you're confusing the tool with the person using it. I use slightly rounded corners (about 3px) on my buttons. A fellow I used to work with - back when someone started using animated gifs on websites - called that stuff "dancing bologna". I agree most of the time. And you can add an intro page with a 5 minute flash video and some of the Silverlight crap some people write.

But letting the user click an update button, and just putting the text "Record Updated" on the page without having to refresh it isn't a "problem". Neither is being able to fill a grid easily, or giving the user a paging capability when your db query returns over 10,000 records. (Don't say the query should be better - the user determines what he wants to search for, and sometimes he has only a vague idea of what he's looking for.) Or letting the user sort on a different column, without having to return all those 10,000 records and sort locally, on a computer not designed to do it quickly. (A large DEC can do an indexed search on a huge database faster than the user can get the Enter key all the way down. Then return the first 25 records. Using AJAX, it's as fast as any desktop app.)

The real world isn't forum software, it's huge data manipulation running on big iron, and the real world needs AJAX.

Would I like an instant page refresh when I submit a post? Yes. Is it necessary? Not at all.
(2011-10-21, 03:24 AM)Rukbat Wrote: [ -> ]Oh, please. You're blaming a lack of ability to use a tool on the tool. JS isn't "fussy" and when things don't work it's because the code is written wrong (or the browser's ECMA-script interpreter is).

...

If every interpreter has it's own set of glitches and inconsistencies, it doesn't really matter how good the tool is. Likewise, if a car's tires can't handle the speeds of the car, it's pretty much useless after a certain point.

Quote:Sorry, no. You're not going to write a very heavy database app (I'm not talking about something lite like a forum, but an app that's the front end for a large [millions of records] database without a lot of JS. Using XML or JSON to communicate back and forth (that's what AJAX is) actually reduces code - and makes for a more pleasant experience for the user. I'm not going back to the 1990 web. No professional would.

>implying we are dealing with millions of database records
>implying we're not just refreshing a page and processing some BBCodes to display on a webpage


Okay, maybe AJAX is a good solution in this case. I'm still not convinced it's the best method for reasons already stated, however.
(2011-10-21, 09:06 PM)Scoutie44 Wrote: [ -> ]
(2011-10-21, 03:24 AM)Rukbat Wrote: [ -> ]Oh, please. You're blaming a lack of ability to use a tool on the tool. JS isn't "fussy" and when things don't work it's because the code is written wrong (or the browser's ECMA-script interpreter is).

...

If every interpreter has it's own set of glitches and inconsistencies, it doesn't really matter how good the tool is.
Nor is that the fault of either Javascript or the programmer.
Quote:Likewise, if a car's tires can't handle the speeds of the car, it's pretty much useless after a certain point.
And blaming the pedestrian the car hits is about like blaming Javascript for Microsoft's refusal to follow standards set by others (which is where the problem lies).

Quote:Sorry, no. You're not going to write a very heavy database app (I'm not talking about something lite like a forum, but an app that's the front end for a large [millions of records] database without a lot of JS. Using XML or JSON to communicate back and forth (that's what AJAX is) actually reduces code - and makes for a more pleasant experience for the user. I'm not going back to the 1990 web. No professional would.

>implying we are dealing with millions of database records
>implying we're not just refreshing a page and processing some BBCodes to display on a webpage


Okay, maybe AJAX is a good solution in this case. I'm still not convinced it's the best method for reasons already stated, however.
[/quote]

It's probably not the best solution for every MyBB installation, but when it comes to web apps, one size doesn't fit all. My server can handle an AJAX chat app refreshing every second with dozens of users. Some servers can't handle one user like that. Running a forum on free shared hosting and expecting the kind of performance you get from a dedicated server is asking to be disappointed.

The main problem, as I see it, is thinking that a single app can be all things to all people with all levels of knowledge. That's like expecting a new driver to be able to handle a race car on the salt flats.
(2011-10-22, 03:33 AM)Rukbat Wrote: [ -> ]Nor is that the fault of either Javascript or the programmer.

No, but like I said the quality of the script doesn't matter if the thing using it doesn't interpret it properly. With almost all other languages and such, this isn't as big of an issue as it is with javascript.

Quote:And blaming the pedestrian the car hits is about like blaming Javascript for Microsoft's refusal to follow standards set by others (which is where the problem lies).

Regardless of who causes the problem, it's still an impacting issue. A chain is only as strong as it's weakest link. The interpreter is part of the JS chain, whether you want to factor it in or not. This is where the problem lies. JavaScript might be the greatest language ever invented but it's crippled by several browsers, and there's no way around that.
Maybe a option to disable this may please everybody.

As Rukbat said, this is not something that is require or needed, but it is a cool feature that may be useful for some.

Previewing the post content without refreshing the whole page may be very handy.
Scoutie, you're saying that if people speed we should eliminate speed limits. You're attacking the result, not the cause. It doesn't work IRL, it doesn't work in programming.

JS isn't going to go away any time soon. Period. (AJAX isn't a separate issue, it's just something you use JS for.)
Quote:You're attacking the result, not the cause. It doesn't work IRL, it doesn't work in programming.

Why can't you grasp that if the browser doesn't work, then the intended functionality isn't there? Haven't I stated this? The browser is part of using JavaScript, like it is for CSS and HTML. Whether you like it or not, the browser does affect how the script works; and when the browser doesn't work properly, the script doesn't either.

"hey guys, we should definitely use this awesome, bug-free scripting language, even though there are 10+ different interpreters for it out there, all of which have their own bugs, and a large portion of the world is still using one of the buggiest!"

Pretty much all I've gotten out of this conversation.

Quote:JS isn't going to go away any time soon. Period. (AJAX isn't a separate issue, it's just something you use JS for.)

I have no issues with that, but I still think we should be cautious where we use it.
We don't need insane AJAX effects. A few peppered here and there would be cool but we don't need every single freaking thing to be AJAX.
Pages: 1 2 3