Web 2.0 Recipes With PHP + DHTML
An anonymous reader writes "Take a look at these full simple code examples for dynamic elements for your web apps, including: Ad boxes, Pop-ups, Spinners, and Tabs. Easy ways to show and hide content on the page." From the article: "Incorporating JavaScript into your page makes the page dynamic and creates a more compelling user experience. Users can get more data more quickly, look at information from different aspects, and seamlessly navigate the site -- and the site doesn't have to go back to the server for lots of pages. However, there's also a reason to avoid using JavaScript: browser compatibility. In the early days of flat HTML, Internet Explorer rendered pages differently from Netscape. Those problems were fixed, but when support for CSS was added, new compatibility issues arose. Now most of the CSS issues have been solved, but JavaScript compatibility issues have cropped up. These compatibility problems have no easy solution. You need to weigh the benefit of what the JavaScript is doing against the number of browsers you'll need to test against and support."
"including: Ad boxes, Pop-ups, Spinners, and Tabs. Easy ways to show and hide content on the page." Then you just mix it in the bowl and BAM! You have upset customers and lost respect!
My biggest hesitancy in using javascript is the IE warning bar that makes any page containing script look threatening. It's no problem with Foxfire, but most people still use IE. How many of them would see that warning and just assume something bad is lurking if they click Allow?
This article's been on the front page for a couple of minutes, with no comments. Perhaps Web 2.0 is tired?
For me, I really like JavaScript and AJAX when it helps to actually improve the user experience. Dynamic tabs? What's the point? How is it really functionally than just heading to a different page, or using some middleware to control what content is served, after a page reload?
Now, on a website I built, I've used AJAX (shudder) to create a commenting system that doesn't require the user to initially be logged in. The user can visit a page, submit a comment through the form, and if the user isn't logged in, they're presented with the ability to login right then and there, without losing their comment, and without even being shuttled off to a different section of the site, wondering if their comment will post when they're finished. If they don't have an account, they can create one right there. I think those kinds of tricks make remote scripting worthwhile.
Plus, I think adding new widgets to HTML through JavaScript is pretty keen - like the sliders and calendar that Yahoo is making available under the BSD license at their developer area.
concrete5: a cms made for marketing, but strong enough for geeks.
I wonder - we should have a competition to see who can make the most obnoxious web 2.0 page. Sort of like 1997 web "1" style - "under construction" gifs, flashing text, and scrolling status bars.
Get your own free personal location tracker
Same goes for Flash...
I can't believe how many companies spent tens of thousands of dollars on a CMS package, or to a "web designer" that rendered them invisible to the search engines.
The article does recommend a fallback for unsupported browsers. Take this to heart, because "GoogleBot" is an unsupported browser.
My ZooLoo
Except for the tabs, these all seem like a pretty bad idea. Nobody wants to click all over to get at information that could have just been displayed in the first place.
hi mom!
Great, instructions for ad-boxes, pop-ups, and spinners (I stopped reading the article before I got to what spinners were, but I'm sure they're obnoxious). This is almost as bad as the fact that Macromedia has a forum on their site dedicated to creating ads. Some people just give humans a bad name.
Next week: Your first phishing page with php and dhtml in just minutes!
I was hoping for some good code, it is from IBM after all, but its nothing more than crappy javascript from '99. Someone buy this guy the DOM Scripting book (http://www.domscripting.com/) and teach him what the seperation of structure (XHTML), presentation (CSS) and behavior (javascript) is all about.
IBM's JavaScript articles are usually high quality. But this one is awful. It uses invalid code, it doesn't degrade gracefully, it mixes HTML, CSS and JavaScript into the same file instead of separating them, and it breaks when you try and do things as simple as open a link in a new tab.
Don't be fooled by the "senior software engineer with more than 20 years of experience" author, this guy doesn't know the most basic, newbie things. I can only imagine that his 20 years of experience was with something other than HTML, CSS and JavaScript. For example:
That's just the tip of the iceberg. This is an exceptionally poor article.
Bogtha Bogtha Bogtha
Customers who use websites might not like that stuff, but customers who buy websites often love it and ask for it by name, and pay by the hour!
This issue is a bit more complicated than you think.
Flash!
Ah-aaaargh!
Seriously though. Flash is an awful choice. One the plus side, you get fairly consistent rendering. On the minus side it completely fucks up your entire interface. Middle-click to open in a new tab? Right-click to bookmark? Shift-click to open in a new window? Ctrl-F? Find-as-you-type?
Flash is great if you want to trade in the quality of the end result for ease of development. But I'd rather put a bit of effort in and get a decent interface rather than put little effort in and get crud. Crud that might look pretty, granted, but still a horrible, horrible interface.
Us begrizzled hippies used the tag for this stuff.
Intron: the portion of DNA which expresses nothing useful.
In the early days of flat HTML, Internet Explorer rendered pages differently from Netscape. Those problems were fixed, but when support for CSS was added, new compatibility issues arose. Now most of the CSS issues have been solved, but JavaScript compatibility issues have cropped up.
Aaaaaaaaaaaaaahhh. My eyes are bleeding. What the fuck are you talking about?
In the early days of HTML, Internet Explorer did not exist.
Only IE and Netscape render pages differently?!
Most of the CSS issues have been solved?!? What?!
Javascript compatibility problems are new?@#$?@#$!?