Modifying my iframe css contents

2019-03-04 17:44发布

问题:

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>


$(document).ready( function () {
    $('#iView').load( function () {
        $('this').contents().find("html").css("background-image","none");
    });
});



  <iframe src="http://l2-playcard.dnsalias.com:85/CRM/web/login.aspx" id="iView" frameborder="0"></iframe>

My iframe background not change please help me ?

回答1:

Your use of an absolute URI implies that you are trying to access content on another domain.

This is impossible (baring the use of postMessage combined with the co-operation of the site you are trying to access) for security reasons.