Cross-domain Ajax
If you want to make a nice widget for someone with some Ajax in it, you will learn quickly one thing : Same Origin Policy.
This security feature is a pain for developer, but usefull for anybody, because this prevent XSS injection for example. But, with this, we can make a query in a different domain with the XMLHttpRequest object.
In reallity, you can, but it’s not the same thing if it’s IE or Firefox or Webkit. For IE, we have the XDomainRequest. This object allow to do Ajax query in a different domain, but, you can’t add some headers, and, the most important, you can’t use cookie with it. Second point, same as Firefox, the browser will check if the requested domain accepts query from you (Access-Control-Allow-Origin header).
For Firefox, you can use the XMLHttpRequest object, but you have to check the Access-Control-Allow-Origin header from server.
For Webkit, I don’t really see a dificulty for make Ajax cross-domain query.
If you need cookies for IE, you can add a wrapper in JSONP, like me. And after that give the PHPSESSID all the time in your queries.
jQuery and scrollTop, how can this work for IE/Chrome/Safari and Firefox ?
Today I have to make a scrollTop for a webpage, and I use jQuery for the most part of the javascript in the website.
So, the problem is, I do $(‘body’).scrollTop(0); and this work for Safari/Chrome, but only for it. So, I looking for a solution in the Internet, and it’s a pain to find one for all. But finally I found one, やった (yatta)!
What is it ? Simply $(« html,body »).animate({scrollTop: 0},0); and it’s work.
CSS a nice popup with a border radius and opacity
Today I try to do a simple and nice popup in CSS without image.
So what I really want to do ?
Simple no ? Unfortunatly not.
One, you need to do the border opacity. For that one thing : If you have an opacity in one element, all its child have the same opacity (an opacity of 1 in the child is the opacity of the parent, an opacity of 0.5 in the child is 0.5*opacity of the parents).
So, I do that with 2 div in the same parents :
<div id= »parents »>
<div id= »child_border »>
</div>
<div id= »child_content »>
</div>
</div>
After that, I fix the opacity of child_border at 0.5 and I put it in center of the screen and x pixel from top. For the child_content I add 10px margin, so in reality I add the same margin-left than child_border plus 10px and I remove 20px from the width. And for the top, just add 10px to top.
So with thatm you have the basse. You have just to add the border radius : for webkit : -webkit-border-radius:10px; For Firefox : -moz-border-radius:10px; And for IE … Nothing for the moment. But you can add the standard border-radius:10px;
For IE opacity is not the same than webkit based browser (Safari/Chrome for example) or Gecko based (Firefox for example), it’s filter:alpha(opacity=50) for an opacity of 0.5.
AkihabaraNews, a new website released
The January 4th, the new website of Akihabara News was online !
It took a really long time until we finally reached release, and I must say we can be proud of the result.
Border Radius in CSS3, how not to do simple ?
When you want a border-radius in your box, you have to choice : use CSS3, because it’s the standard or not.
The CSS3 is cute, nice, other stuff, but, Firefox and Safari (and IE) don’t implement it for border-radius …
How can I do ? In Safari, it’s easy, just to add -webkit- (ex : -webkit-border-radius). For Firefox, it’s -moz-border-radius too. But if you want use border-top-right-radius, or other specific choice, in Firefox, it’s -moz-border-radius-top(no space, no -)right.
Safari it’s juste -webkit-border-top-right-radius.
Simple no ?
(But only Safari support an another propriety : -webkit-box-shadow, with that, you can add a shadow to your box, and it’s very cool)
My first snowstorm in Québec !
Hi, today, in this afternoon, I can see my first snowstorm ! (Ok, my second, the first is when I come in Quebec)
When I remember my grandfather and his ‘No snow if the temperature is not 0°C … For the moment, I can see -7°C, and a lot of snow fail from the sky. Why ? I don’t know.
In 21 days, I go to Japan, and, I think, I’ll never see other snowstorm in Japan. But I’ll see a lot of japanese schoolgirls ! The dream !
Little multi-image display script in Javascript
This is a little script made in CSS and JavaScript.
It’s a little multi-image display script with the ability to display 4 images and two lines of related text per image. You can do anything with this code, as long as you comply with GPL v2.
To test : http://precea.jp/prepre/carrousel
To download it : http://precea.jp/prepre/carrousel/carrousel.zip
La France, sont gouvernement et le Net …
Aujourd’hui, je reçois un étrange mail sur la mailing d’OVH. Voici le message :
Bonjour,
C’est triste de constater que le monde politique français n’utilise pas systématiquement de noms de domaine en .fr et ne s’héberge pas en France.
La peur de la loi LCEN ? Le boycott de la loi HADOPI/HADOPI 2 ? Et pourtant il y a plein de bons hébergeurs en France qui font parfaitement bien leur boulot. Et pourquoi un .com ??? Le .fr n’est pas assez français ? Non, je ne comprends pas. Ce sont les évidences, ça saute aux yeux, et pourtant … bon … il ne reste plus qu’à avoir désir de faire mieux la prochaine fois … mais faites passer le mot que le Net en France ça existe et ça marche pas trop mal …Amicalement
Octave
Avant cela j’avais vu l’excellant site suivant http://www.desirsdavenir.org/
Et ça tombe bien, il y a une réponse assez bonne :
c’est pas la période en ce moment pour du made-in-france…
la nouvelle de la semaine : http://www.desirsdavenir.org/, mort-né après sa refonte, et qui a déjà était parodié des centaines de fois (ex : http://www.meme-desirsdavenir.com/ ).
c’est français malheureusement, hébergé chez 1et1, et ça a couté 41k € pour une page d’accueil à chier et un joomla mal intégré…
![]()
Comme quoi, le Net en France ….
Hadopi, petite vidéo du jour
Bon, mon colocataire québécois ma donné aujourd’hui un lien vers une vidéo assez intéressante sur Hadopi.
Bon, je préviens à l’avance, c’est une caricature mais elle est bien faite.
La vidéo ? La voici : Vidéo sur Youtube
Bon, et une deuxième faite par la Quadrature du net : Sur Youtube encore












