felipeNascimento.org(true);

Making the web a better place to live

Browsing Posts in Learned Stuff / Tips

PHPSCConf

No comments

O evento, ocorrido em Joinvile (http://phpsc.com.br/), nos dias 27 e 28 deste mês foi ótimo. Os organizadores mostram cada ano mais maturidade, as palestras conseguiram ser tanto focadas na parte mais técnica quanto focadas no mercado, metodologias, etc. A platéia também parecia bem interessada, apesar de terem ficado bastante distribuídos entre demais cursos que aconteciam durante o evento.
É a comunidade PHP mostrando o poder que tem no Brasil e na reagião Sul.

A palestra sobre o theWebMind foi bem divertida e positiva, vários demonstraram interesse e acredito que conseguiremos atingir mais pessoal capacitado e interessado em colaborar, o que é sempre muito importante para o projeto.

Parabéns aos envolvidos e palestrantes. Obrigado a todos e até o ano que vem!

Slides da palestra: http://tinyurl.com/259zbre

Hi, yesterday I had to fight against this problem, which is not very touched out there.
In the beginning, people from jQuery thought it was a jQuery bug, but searching a bit more I could find out the root of this problem.

What is it?
When running your javascript in Internet Explorer 6, or 7 or 8 in compatible mode, if you create dynamically an iframe, for example, and set it a name attribute, Internet Explorer will reaplace it by an submitName attribute. This attribute cannot be found with .getAttribute(’submitName’), but that is the problem, neither can be with .getAttribute(’name’)!

How to see it happening? Try this:

var ifr= document.createElement('iframe');
ifr.setAttribute('name', 'iFrameOne');
document.body.appendChild(ifr);
alert(ifr.getAttribute('name'));
// you can also see it through the "developer tool" in the IE tools menu

The main problem is that … when you have something like a link or a form targeting this iframe, you loose it! The same happens with inputs with name, which are dynamically created.

How to fix it without ask your users to migrate to a real browser? I did this and it worked:

var ifrDiv= document.createElement('div');
ifrDiv.innerHTML= "<iframe name='iFrameOne' ></iframe>";
document.body.appendChild(ifrDiv);

Now, why does it happen?!
I had the chance to search for this and found in the Microsoft’s webpage something about this old, known bug in Internet Explorer, with names on dynamic elements. Due to “fix” this, instead of fixing, then “provided” this workarounded attribute. When you try to deal with the name attribute, it applies like an alias, redirecting it to the Microsoft’s Internet Explorer imaginary submitName attribute. But with this, you cant access a form that has a name, like this:

document.forms['dynamicFormName'];

because the DOM hasn’t rendered that form with the name you asked for.

I hope it can help you, if you get stuck with this some day.

Hey, olá pessoal.
Bom, esta é uma pergunta que vejo muita gente fazendo, então, decidi postar aqui sobre isto.
Temos no javascript, quando lidando com a API DOM, o elemento history, com o qual podemos avançar ou regredir conforme o nosso histórico de navegação, além de podermos especificar a página que queremos carregar com o uso do método go, indicando valores menores que zero para o passado, ou maiores para o futuro.
Por tanto, podemos fazer desta maneira:


history.go(0);

Isto irá simplesmente recarregar a página. Claro que você pode usar iframes, adotando parent, top, self ou name para trabalhar com suas relações.

Outra alternativa seria usar o método reload, oferecido pelo location, assim:


self.location.reload();

Agora, uma outra alternativa que também servirá para mover-mos para uma nova página, usando a propriedade href, também do location.


self.location.href= self.location.href;

Este código recarregará a página, ms poderia ser qualquer outro endereço alí, a ser carregado.

Adicione uma animação ao exibir seus twittes no seu site ou blog.
Com o Tweety (nome temporário, provavelmente), você pode especificar sua conta no twitter e receber um pequeno script para colocar esta animação na sua página web ou blog. Simplesmente precisará copiar e colar este código que lhe foi entregue, onde quiseres. Ele randomizará entre seus 4 últimos posts no twitter, alternando a cada minuto.
Na minha página inicial há um exemplo dele funcionando, mas abaixo, segue mais um:

Caso você seja um desenhista e possa preparar novos exemplares, ou tenha encontrado algum bug ou até mesmo queira simplesmente dar alguma ideia bacana, entre em contato ;)

Testando Firefox 4 Beta 1

No comments

Well, Firefox 4b1 has just been lauched and we had the chance to test it and use it for quite a while.
The first thing I did was to test it running some crazy heacy scripts, like http://bit.ly/DvVL and http://bit.ly/ppahL. I gotta say, it was impressive. Those scripts simply couldn’t run at Firefox in the previous version, now, they run just as chrome does. It made me happy about this release.
Then, testing it with acid3, it reached the 97 points. I think it could be better, specially because either chrome, safari and opera reached 100. Though, those 3 missing points are related to the SVG Fonts, which were deliberately not implemented, using WOFF instead, as you can see in the Mozilla’s developers blog.
At html5test.com, firefox 4 had 189 points. Chrome was the only better, with 197. IE had 27, as I thought.
When testing selectors and CSS3 here, I notice there are only a few properties/methods that only chrome offers more than Firefox.
The problem I have to point by now is that no one single add-on worked on this version. Even mine didn’t work ok and I’ll have to change some details at them.

About the layout, I’m personaly happy they didn’t take off the status bar, as many people had asked for(if I wanted a browser without a status bar, I’d rather use Chrome). Still, if you use windows vista or Seven, you may have some new advances, like the special button at the top of the window, removing the usual menubar, adding it to the title bar.

I do think there are many things to get better or to be increased in Firefox 4 before its release candidate. It promises a lot and I’m really glad to see the browsers walking toward the same point. The future developers will be happier and faster :)