javascript - Does the same-origin policy count for CSS styling? -
i working booking system handles our sites bookings our customers. when customer checks room availability, done on booking site, (redirected) not on our site.
my question is: regards same-origin policy, count css styling? allowed change background color match of ours inside iframe?
it has nothing same-origin policy - applying css file iframe possible, though not recommeded. can create link
element refer css file , set inside iframe:
var link = document.createelement("link"); link.href = "http://example/css/style.css"; // css url link.rel = "stylesheet"; link.type = "text/css"; frames['frame1'].document.body.appendchild(link);
this code "pushes" iframe's html link css file.
note: if iframe's html source existing css rules have overriding styles (for example, set !important
), css values may overruled.
Comments
Post a Comment