Ich habe folgende Arbeits Code, der nur einige Arten in einem IFramed TextArea- gilt:Bewerben jquery in Verbindung innerhalb eines Iframes
`$("#ctl00_m_g_f2a05a6e_efee_4fc1_9c2f_7bb3efaa99a9_ctl00_txtDescricao_iframe").contents().find("body").attr("style","font-size: 11pt !important; font-family: 'Segoe UI', 'Segoe UI Web', 'Segoe UI Symbol', 'Helvetica Neue', Arial, sans-serif !important; background-color: #FFFFFF !important; border: 0px !important;")`
Und ich habe die folgenden nicht-funktionierenden Code, der ein Bild hinzufügen sollten, wenn sie feststellt, ein Link:
$('#ctl00_m_g_f2a05a6e_efee_4fc1_9c2f_7bb3efaa99a9_ctl00_txtDescricao_iframe a').append('<img id="LinkImage" src="http://server/Link.png" />')
Der Versuch, beide Code zusammen aber ohne Glück zu setzen.
Update:
var $frameContents = $("#ctl00_m_g_f2a05a6e_efee_4fc1_9c2f_7bb3efaa99a9_ctl00_txtDescricao_iframe").contents();
//works
$frameContents.find("body").attr("style","font-size: 11pt !important; font-family: 'Segoe UI', 'Segoe UI Web', 'Segoe UI Symbol', 'Helvetica Neue', Arial, sans-serif !important; background-color: #FFFFFF !important; border: 0px !important;");
//dont work
$frameContents.find("a").append("<img id='LinkImage' src='http://server/Link.png' />");
//dont work
$frameContents.find("img").attr("style","border: 1px #EDEDED solid; padding: 8px; margin-top: 5px; margin-bottom: 20px;");
Sollten Sie eine ID von 'a' haben, an die Sie img anhängen möchten? –