Editing Facebook Like-Box Css on FLY?

I am not an encoder, but most of the time I can get around the code. However, I found this to be the best place to ask code related questions.

I am working on a website for a client, and I am at 95% - the only problem I encountered is facebook like-box. I found several manuals on the Internet to change the css box I liked, and I followed most of the recommendations, but I have no positive results.

Please - help stackoverflow!

I know jquery / javascript is a very powerful language. And facebook like using javascript iframe / xfbml.

what code would you use if you could modify the elements of the CSS field, how to load them.

I say load because I load my mailbox through ".load" ajax. That way, when the user clicks the facebook button, jquery loads it.

In short: how can I edit the css file on the fly and then download the edited version afterwards.

thanks

+4
source share
1 answer

The main problem that you are facing is that the FB Like button is loaded inside the iframe - a standalone HTML document on your page (if you use firebug or the webkit inspector to check for a similar button, you will see it is within the <body> , <html> , then <iframe> ).

The thing about these offline pages is that you cannot access or manipulate them from the surrounding document (your page). You can change the 'src' attribute (specify an iframe to load a new page), but you cannot apply or change styles on elements within the page. This is the security limitation that browsers have.

I know that it is possible to have a custom type button, but I don’t think it was done using the iframe method.

+4
source

Source: https://habr.com/ru/post/1341197/


All Articles