If you’ve to debug some script in Safari, and you’d wish to write into the javascript console, the simple advice is to use the same code as in Firefox.
console.log(object);
That’s all.
If you’ve to debug some script in Safari, and you’d wish to write into the javascript console, the simple advice is to use the same code as in Firefox.
console.log(object);
That’s all.
The project I’m working on finally released as Beta – www.mayomo.com
MaYoMo is a “social news network” for journalists and their readers that empowers a new era of Internet news creation and distribution. With an ever-expanding corps of citizen and independent journalists based in every corner of the globe, MaYoMo is shaping the evolution of journalism and delivering the world’s most inspired multimedia news content. Now, thanks to MaYoMo’s highly unique and entrepreneurial “news channel approach,” professional, amateur, and student journalists can create and manage their own custom news channel, unleashing new career and business opportunities based on the company’s shared revenue advertising model. MaYoMo lets you discover the power of news like never before and experience the new future of journalism and news content distribution.
Everybody knows how different is to attach event listeners under different browsers. Under IE is attachEvent(), while under FF is addEventListener()! The compatibility can be checked in the PPK site www.quirksmode.org where the author describes in detail where a given event listener can be registered and how it should be done.
Important part of the events in JavaScript is the so called “event bubbling“. You know, when you click on a given DOM element when bubbling is on the DOM elements containing this specific DOM element receive the event. So when I move the mouse over a DIV element the event mousemove is received in every element containing that DIV up to the window object.
In Mozilla it should look like this:
element.addEventListener('mousemove', callback, false);
Where the third parameter is describing the use of event bubbling, when setup to false, and if it’s set to true the other type of event handling is used, the so called capturing, which in breaf is the oposite of bubbling and the event is propagated from the top to bottom. The problem under different browsers is that sometimes this “mousemove” is not enough. In the case of mousewheel there are several combinations.
In IE:
document.attachEvent('onmousewheel', function(e){
if (!e) var e = window.event;
e.returnValue = false;
e.cancelBubble = true;
return false;
}, false);
In Safari:
document.addEventListener('mousewheel', function(e){
e.stopPropagation();
e.preventDefault();
e.cancelBubble = false;
return false;
}, false);
In Opera:
document.attachEvent('mousewheel', function(e){
if (!e) var e = window.event;
e.returnValue = false;
e.cancelBubble = true;
return false;
}, false);
In Firefox:
document.addEventListener('DOMMouseScroll', function(e){
e.stopPropagation();
e.preventDefault();
e.cancelBubble = false;
return false;
}, false);
Note the differences between all the browsers.
If there’s a flash movie into your page using the AMF protocol to speak with the other part of the site, there may be a bug under Internet Explorer version 6 … again. The AMF protocol stands for Action Message Format is simply JavaScript – Actionscript way to get connected. And it simply registers the callbacks from both sides. So there’s simply a object/embed pair in the HTML and a Flash movie using AMF, and IE6. Everything’s OK until leaving the page. On unload the window object the generated JavaScript code breaks and throws an error. Usually it’s something like that:
function __flash__removeCallback(instance, name) { ... here instance is given null under IE6 }
Reading some forum posts it may be working if I was using a js/flash library such as SWFObject, but I don’t want such, because of one another JavaScript file loading and blocking the content. I just wanted the object/embed to be in my page. Continue reading
While developing your next site, you’ve may noticed that under IE, specially version 6, it’s very hard to debug any kind of JavaScript code. Yes actually if you’ve configured the browser for that purpose you may get any message, which unfortunately is completely useless. In general the message is something like: “There’s an script error on some line of the code!”, but very often there’s no such line of code or it’s empty or something else. Actually that poor debugger is giving the error by the generated script code which really does not help.

The installation of Microsoft Script Debugger solves this problem. It gives the line and the code, even highlights the error.