The Css Bug

The Yahoo – Bing thing

Today, Microsoft, The Redmond Giant, announced a patnership with Yahoo that in their words will change the world of serch engines. Microsoft will now power Yahoo! search while Yahoo! will become the exclusive worldwide relationship sales force for both companies’ premium search advertisers.

“This agreement comes with boatloads of value for Yahoo!, our users, and the industry. And I believe it establishes the foundation for a new era of Internet innovation and development,” said Yahoo! Chief Executive Officer Carol Bartz. “Users will continue to experience search as a vital part of their Yahoo! experiences and will enjoy increased innovation thanks to the scale and resources this deal provides. Advertisers will also benefit from scale and enjoy greater ease of use and efficiencies working with a single platform and sales team for premium advertisers. Finally, this deal will help us increase our investments in priority areas in winning audience properties, display advertising capabilities and mobile experiences.”

“Through this agreement with Yahoo!, we will create more innovation in search, better value for advertisers and real consumer choice in a market currently dominated by a single company,” said Ballmer. “Success in search requires both innovation and scale.  With our new Bing search platform, we’ve created breakthrough innovation and features.  This agreement with Yahoo! will provide the scale we need to deliver even more rapid advances in relevancy and usefulness.  Microsoft and Yahoo! know there’s so much more that search could be.  This agreement gives us the scale and resources to create the future of search.” said Microsoft CEO Steve Balmer.

Bing will become Google’s main competitor in search, with a market share of about 28% in the US  and about 11% worldwide.

In my opinion another bad move for Yahoo, which for a long period, until 2004, used to be powered by Google, which I belive was one of the reasons Google became so popular in the first place.

Ever tried to use the onChange event to catch a change of state in a radio button group? The following code works alright in Firefox, but not in Internet Explorer:


<input type="radio" name="options" id="option1" onChange="alert('option1')">
<input type="radio" name="options" id="option2" onChange="alert('option2')">

IE treats the onChange event in a different manner: it recognizes something changed just after you lose focus on that element. The solution for this problem is to use the onClick javascript event instead of onChange.


<input type="radio" name="options" id="option1" onClick="alert('option1')">
<input type="radio" name="options" id="option2" onClick="alert('option2')">

As I’ve wrote earlier this week, Google is leading a silent battle against Internet Explorer 6, the 7 year-old browser that is still causing tons of problems to web developers. A first major step, was the announcement that YouTube is no longer supporting IE6, which was more of a statement then a strategic decision – since most of YouTube features will probably still work for time to come.

More likely the stake, must be the recently announced Google Wave, the most anticipated web application of the year which is packed with state-of-the-art HTML 5 technologies – some of them not fully supported even by the latest version of browsers (like drag-and-drop), and which Google is trying to sqeeze into the HTML 5 specifications. It is clear that  Google Wave is not likely to work with the age-old Internet Explorer 6, so Google is doing his best to determine users to upgrade to Chrome or some other latest generation browser.

YouTube drops Support for IE6

It looks like the end is finally ariving for our least favorite browser IE6 as SitePoint announces. It’s survived longer than any of us could have expected and it still has a larger market share than Chrome, Safari, and Opera combined. Whilst some smaller web sites have dropped support for the 8 year-old browser, none of the bigger companies dared cut off a fifth of their users. Until now.

YouTube, the Google-owned video sharing web site, is phasing out IE6 support. YouTube is one of the largest and most popular web sites on the net, so this action could have a massive impact on user numbers.

IE5.5 and IE6 visitors to YouTube are now confronted with a message and helpful IE8, Firefox and Chrome download links.

There is some evidence that IE usage has dropped within the past month, although the new releases of Firefox and Safari are partially responsible for that shift. However, the YouTube announcement could certainly persuade many private IE6 users to upgrade their browser.

What’s new in Forefox 3.5

Firefox 3.5 is a pretty substantial update to the popular open-source browser, and it’s just around the corner. See what features, fixes, and clever new tools are worth getting excited about in the next big release.

10. Undo closed window
9. Forget this site
8. Tab tearing
7. Keyword AwesomeBar filters
6. Smarter session restore
5. Private browsing mode
4. Color profiles that pop
3. TraceMonkey JavaScript engine
2. Geo-location
1. Video superpowers with HTML 5

from LifeHacker

PHP file uploads

A common challenge faced by PHP programmers is how to accept files uploaded by visitors to your site. In this bonus excerpt from Chapter 12 of the recently published SitePoint book: Build Your Own Database Driven Web Site Using PHP & MySQL (4th Edition), youll learn how to accept file uploads from your web site visitors securely and store them.

full article on SitePoint

Wamp wamp

With the lunch of the 4th edition of the “Build Your Own Database Driven Web Site Using PHP & MySQL” book, the SitePoint team starts by offering a superb free tutorial on installing the WAMP platform.

WampServer (where Wamp stands for Windows, Apache, MySQL, and PHP) is a free, all-in-one program that includes built-in copies of recent versions of the Apache web server, PHP, and MySQL.

Full article on  SitePoint

HTML 5 Today

New Features for Web App Developers

With HTML 5’s emphasis on web application development, there’s plenty of new features for developers to use, some of which we can use today:

  • A 2D drawing API for scripting graphics using the new canvas element, which is supported in all the major browsers except for Internet Explorer.
  • registerProtocolHandler and registerContentHandler, which allow web applications to register for certain protocols or MIME types. Both are available in Firefox.
  • A manifest caching mechanism to support offline web applications, available in Firefox and Safari.
  • Video and audio APIs. The majority of the API works in Firefox, Opera (experimental build), and Safari—although Safari only uses Apple’s proprietary .mov format, rather than the open-source Ogg formats supported by Firefox and Opera.
  • window.postMessage: cross-document messaging implemented in all major browsers.
  • history.pushState to enable better back-button support in Ajax apps. (No implementations yet, but window.onhashchange is supported in IE8.)
  • A drag and drop API with a draggable attribute, supported in Firefox 3.5.
  • An editing API that hooks into the contenteditable attribute allowed on any element, already in all major browsers.
  • Client-side persistent storage using key/value pairs and support for embedded SQL databases: key/value pairs are in Firefox, Safari, and IE8, while SQL is supported only in Safari at this point.

For more read the full SitePoint article

Javascript lose focus

When making fancy web 2.0 javascript form validations, sometimes you may want to validate a html textfield right after the data was entered. What you need is to cacth the ‘textfield lose focus’ event‘, that is when a user enters some data into the textfield and then either clicks outside the field or ‘tabs’ to the next field.

The JavaScript lose focus event is actually called onBlur, and is suppoerted by the following HTML tags:


<a>, <acronym>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>,
<button>, <caption>, <cite>, <dd>, <del>, <dfn>, <div>, <dl>,
<dt>, <em>, <fieldset>, <form>, <frame>, <frameset>, <h1> to <h6>,
<hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <label>,
<legend>, <li>, <object>, <ol>, <p>, <pre>, <q>, <samp>,
<select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>,
<td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>

and the following JavaScript objects:


button, checkbox, fileUpload, layer, frame, password, radio, reset, submit,
text, textarea, window

Usage example:


<html>
<head>
<script type="text/javascript">
function upperCase()
{
var x=document.getElementById("fname").value;
document.getElementById("fname").value=x.toUpperCase();
}
</script>
</head>
<body>

Enter your name:
<input type="text" id="fname" onblur="upperCase()">

</body>
</html>

MySQL String Replace

There is common problem I have when working with large user ganereted databases. Sometimes the forms that you provide ofr the users are not self-explanatory, and the whrong kind of data gets into the databse, the kind that you don’t expect. This time I provided a filed for the user’s personal websites, and some of them didn’t provide the entire path, that is www.thecssbug.com instead of the http://www.thecssbug.com. As you know if you provide a link like this:


<a href="www.thecssbug.com">The Css Bug</a>

the browser will not interpret if correctly. The solution in my case (appart from a form change) is a SQL Mass Replace.


UPDATE userProfile SET webSite = REPLACE(webSite,"www.","http://www.")  WHERE webSite LIKE "%www%" and webSite NOT LIKE "http%"

In general:


UPDATE table_name SET column_name = REPLACE(column_name,"original_string","replace_string")
« Previous Entries  Next Page »