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 28 2009

Firescope : Firefox addon

Tag: web developmentvish @ 7:02 am

Found a new addon for firefox, FireScope. It extends Firebug with reference material for HTML and CSS. Look out for items in the context-menus, that say things like Look up “blah” attribute, or Show Code Example.

The add-on is being developed by SitePoint an online resource for Web professional market, specifically Web Developers and Designers.

Tags: firebug, firefox, firescope

Jan 22 2009

SOAP, REST and RPC

Tag: web developmentvish @ 10:10 am

Since last 2 years I’ve been using and creating various web-services. I had very basic idea about these and never thought about going into the details. Y’day night I somehow got enthu to digg into it and findout what are best practices, when to use what, differences and other details.. so here are some pointers on what I read..

  • SOAP – Simple Object Access Protocol
  • REST – Represntational State Transfer
  • RPC – Remote Procedure Call
  • REST is not simply XML+HTTP, it is valid to anything which conforms to RESTFul principals.
  • REST vs RPC = noun vs verb… i.e exchanging resources and concept vs exchaging methods : A good example.
  • REST vs SOAP : With SOAP, data exchange takes place with a additional Soap layer. It contains a SoapEnevlop which further contains header and body. With REST the request or response could be in any format, just that it should have a unique resource(URL) and it should specify a valid http method (GET,POST,PUT,DELETE).
  • REST : secure, easy to use and light weight.
  • REST isn’t best for every case : Sending secured data as params or sending large amount of data could be a problem. In which case you might want to use SOAP.

Further these articles (other then wiki) are worth reading.

Tags: AJAX, REST, RPC, SOAP, WebServices

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

Jan 06 2009

Write code in your blog

Tag: web developmentvish @ 12:12 pm

If you are writing a tech blog, most likely you would need to write code in the blog posts.

Here is an article which lists plugins that can be used for writing code and syntax highlighting.

I’m using a very light weight plugin SemCodeFix, for this blog.

Tags: blogging, css, styleing, wordpress

Jul 21 2008

Fixed position div for IE

Tag: web developmentvish @ 6:12 pm

Nice css article for keeping a div in fixed position on IE.

Tags: css, style

May 05 2008

10 ways to increase your website traffic

Tag: startups, web developmentvish @ 5:17 pm
  1. Press release : Make sure with most important updates, feature addition on your product/website have a press release. You can post on prweb.com, a little google search can provide you a list of many free pr sites.
  2. Social networks (Orkut, Facebook, Myspace, LinkedIn) and Social bookmarks: You can create groups, communities related to the field you website is. Bookmark interesting articles to websites like digg, delicious, digg clones in ur related field.. you can use share this as well..
  3. Blog / Forums : Create a blog on wordpress/blogspot, submit feed to various search engine, technocrati etc.. Use backlinks. Post on public forums in related field.
  4. Adwords : Good way to generate traffic, you can start with google adwords.. there are many others as well.
  5. SEO and Directory submissions : Submit on various web directories ( Dmoz.org-free, Dir.Yahoo.com-paid..  and many others). Submit it to all search engines. Search optimize your website. (nice tutorial)
  6. Newsletters : This is for existing users of your website, to keep visiting your website. And can be a means to provide them regular updates.
  7. Email Signature : Create business cards and make sure provide link to your website via the same.
  8. Viral Videos : Create a few viral videos related to field.. website is in.
  9. Make partners : Contact with people working in your field. Partner with as many people as you can.
  10. Wikipedia : Create a wiki page for your website/product.

Tags: seo, web traffic

Mar 05 2008

Widgets, apps etc..

Tag: web development, widget/pluginsvish @ 6:09 pm

Create widgets/facebook apps from rss feeds or your website itself in just few minutes using any of these..

http://www.clearspring.com/

http://widgets.yahoo.com/tools/

http://www.widgetbox.com/

Tags: widgets

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