Feb 03 2009

Javascript : Iframe : Cross domain scripting

Tag: web developmentvish @ 5:30 pm

Probelm :- Your page with domainA.com has an iFrame of domainB.com. You have some task, that needs you to call a javascript function in main page (domainA.com) from iFrame (domainB.com).

Hack :- I googled and found two solutions, both work for most common browsers but both have some limitations. ( Obiously its a security issue )

  1. First one I found at pipwerks. For it to work you must have access to web directory of parent frame (domainA). You need to upload a file there (proxy.html). According to it, you can put nested iframe from domainA into domainB. And call a function from this iframe instead, using top.functionName
  2. Other hack is from tagneto. To use this, you need to change parent.location adding a hash(#) to it. This won’t reload the page and hence it works. Here is a test page as well. See the source of test page and embedded iframe to check how it works.

If you know about any others? Lemme know.

Update :- approach 2 has some issues with IE7, its fixed here.

Tags: crossdomain, javascript, web development

Jan 21 2009

What’s with HTML5 ?

Tag: web developmentvish @ 2:27 pm

Work on HTML5 is still going ( joint effort by W3C and WHATWG ), but there’s a lot of buzz around about it.

Again googled and saw many articles on it, so no point writing about same again. I didn’t find wiki enough informative.. but liked these two posts on phpGuru and aListApart.

The idea of having a async attribute is cool, which means script can be executed asynchronously and won’t block loading rest of the page. Also something new will be tags like video, auido & canvas.. and a few interactive elements including menu and datagrid.

There’s a list of elements which will be dropped including frame, font, center, applet etc :) , make sure you don’t use them now.

I heard a lot about support of drag and drop API in HTML5, seems like its started with IE + safari and now firefox is also supporting it.  A post by Neil on how to use it and more info on developer docs.

Tags: drag & drop, html5, web development

Jan 12 2009

Firebug like tool for IE : IEWatch

Tag: web developmentvish @ 5:39 am

Firebug, no doubt is the most important tool for web development. And firefox the coolest browser :) .

The only problem is with so many people using IE, you can’t just ignore it. Recently I’ve found a nice tool similar to firebug for IE, IEWatch. You can watch http traffic and inspect elements.  Its not free but you can use trial version for 30 days.

Also found this post on IEBlog, which has a good list of tools which can be used for web development.

Tags: firebug, firefox, IE, iewatch, web development

Nov 19 2007

CSS positioning

Tag: web developmentvish @ 2:49 pm

Found a nice article on css-positioning, which explains it in 10 easy steps.

Tags: css, positioning, web development