Find and replace img src in iframe with jquery -
i feel i've been searching forever solution.
i want replace image url 1 on site i'm displaying in iframe. after hours of research i've done i've landed on using jquery handle task.
unfortunately, of solutions i've found use click event trigger changes in iframe. want change happen on page load.
i have limited jquery experience answer , right in land, haha.
so far i've found code supposed identify class contains image want replace i'm not sure how use replacewith(or if right thing use) in jquery.
this code have been using:
<html> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <script type="text/javascript"> $(function() { //here have control on body of iframe document var ibody = $("#iframe").contents().find("body"); //here have control on element (#mycontent) var mycontent = ibody.find("#brandingpane"); }); </script> </head> <body> <iframe src="https://customer.itsaconnect.co.za:8444" width="80%" height="600" id="iframe" ></iframe> </body> </html>
i want replace img url in "brandingpane" div image url (any demo url now)
please help!
Comments
Post a Comment