开发者

Should I use js or iframe for a widget?

开发者 https://www.devze.com 2023-03-29 18:20 出处:网络
I don\'t know the advantages and disadvantages of using them.开发者_如何学JAVA I would like to know how they behave differently for

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

开发者_如何学JAVA

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消