Anush
Anush

Reputation: 1050

Should I use js or iframe for a widget?

I don't know the advantages and disadvantages of using them.

I would like to know how they behave differently for

->cookies
->styling
->performance
->ease of use
->ease of implementation
->flexibility
->other pros/cons
->your preference

Upvotes: 0

Views: 234

Answers (1)

AppleGrew
AppleGrew

Reputation: 9570

If I were you, I would use JS.

JS Pros:-

  • No cookie restriction. IE rejects iframe cookies if P3P headers are not set.
  • No DOM access restriction. Interacting between JS codes in parent and iframe codes is not easy and needs workarounds. Not beautiful.
  • Performance is not a big deal for JS on today's browsers.
  • You get more flexibility here, because of first two points.

Which you feel is easier is debatable. I see no cons for JS.

Upvotes: 1

Related Questions