I am trying to add a css file to an iframe that is being created on a page from a global script. I can access part of it, but for some reason I cannot add it to my head. This also does not throw mistakes, which disappoints.
<script type="text/javascript"> $(document).ready(function() { $('#outline_text_ifr') .contents() .find('head') .append('<link type="text/css" rel="stylesheet" href="/include/outline.css" media="all" />'); }); </script>
var $head = $("#IFrame").contents().find("head"); var url = "Styles/styles.css"; $head.append($("<link/>", { rel: "stylesheet", href: url, type: "text/css" } ));
or
$('#IFrame').contents().find('#div1').css({ color: 'purple' });
Source: https://habr.com/ru/post/1334106/More articles:Updating various fields of a structure at the same time - is it safe? - cGoogle Apps - sending email with an alias - emailIs there an advanced javascript editor that will do things like "go to definition" like Visual Studio? - javascriptBest heuristics for malloc - memory-managementSalesforce / SOQL - given child, how to return the parent account of the "top level"? - apex-codeUse or not use Data.Map - data-structuresReverse engineering a ROM DOS device - embeddedWhat, if any, injection vulnerabilities exist in bash and how can I protect them? - securityIs there a script that can do a full remote backup? - phpSuggestions for backing up php site and mysql db - phpAll Articles