In the comments for my post from the other day titled “Encapsulating Ajax XMLHTTPRequest Calls within JavaScript classes”, Kevin F noted that using document.write was not allowed within an XHTML document.
Now, this isn’t directly related to Encapsulating Ajax calls, as you could have a non-visual class that doesn’t need to write visual content out to the browser. However, I wanted to post an update to the original example that shows how to do this that would be valid within an XHTML document.
The guys over at Fold posted an article on how to use multiple XMLHTTPRequest (XHR) calls within a single page. This is something that I have had to tackle in my own work, and though I would write up how I solve this issue.
This post describes a simple technique for encapsulating XMLHTTPRequest calls within JavaScript classes. In general, this makes code more maintainable, allows for the creation of easier to use APIs, and makes it much easier to create components / widgets that load data from the server.
As Emmy posted, we have just released new Flash Player penetration numbers.
Flash Player 8 can be viewed by around 50% of people online (45% US, 55% Canada and Europe). That is pretty amazing considering that the player was released just 5 months ago. This puts the player on course to reach 80% in well under a year from release.
You can view all of the stats here.
Anyone know of an ActionScript 3 one?
I have been doing some JavaScript / Ajax development over the past couple of weeks, and have been trying to figure out the best way to structure my JavaScript and HTML code. One thing that really surprised me when doing research is how many JavaScript projects / examples do not try to encapsulate their code (aside from within script files) or use object oriented programming. Thinking back on this, and given the evolution of JavaScript from a web scripting glue to more of an application programming language, I can understand this, but it did surprise me none-the-less.
I have uploaded a new version of the Macromedia News Firefox extension. This version adds support for Firefox 1.5.
Sorry it took so long.
You can find more information, as well as install the extension from here.
Ill probably do another build in the coming weeks to update the name and branding.
If you run into any issues, just post them in the comments.
Just a quick fyi, but if you are doing work in JavaScript and need to dynamically remove all of the childNodes from a DOM element, make sure to do it with a while loop, and not a for loop.
For example, this is bad:
function removeChildrenFromNode(node)
{
if(node !== undefined)
node !=== null)
{
return;
}
var len = node.childNodes.length;
for(var i = 0; i < len; i++)
{
node.removeChild(node.childNodes[i]);
}
}
Since, as soon as you remove one child, the length of node.childNodes is 1 smaller, and you will eventually access an index that does not exist (and get a JavaScript error / exception).
Just a quick fyi, but I just fixed the issue with the Macromedia News Firefox Extension that was keeping it from working in Firefox 1.5.
As I suspected, it was the same problem that I posted about earlier.
Anyways, I will post an updated version later tonight or first thing in the morning.
Useful post by Bill Scott. Most of them apply to both Flash and Ajax based RIAs.
If you are interested in this, you might also want to check out the Adobe XD (experience Design) blog.
via Ajaxian.
Just a quick fyi, but my mesh@macromedia.com email address is going away. It has been killed by spam and viruses. I got an email from IT last week letting me know that for that day I had received 96,000 virus emails (most of which were blocked before they got to me). Needless to say, this was a concern, and so I am having to retire the email address.
Anyways, I do still have mesh AT adobe DOT com, so mesh is still around. If you have my email address and need to ping me from time to time, make sure that you update your address book (unless you have a virus that is going to send emails in my name).