I have an <object>
element in a page that embeds another page, with an iframe fallback as recommended here: http://www.kgsteely.com/information-technology/using--lt-object-gt--instead-of---lt-iframe-gt.19.html
I am looking to use a dropdown with jquery to change the elements if selected. I got the iframe to ork, but I have not gotten the object to work. What am I doing wrong with my javasctript selector to make this work?
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<select id="selector">
<option value="0">Select Project</option>
<option value="http://google.com">Google</option>
<option value="http://yahoo.com">Yahoo</option>
<option value="http://codecanyon.net">CodeCanyon</option>
</select>
<!--[if !IE]>-->
<object data="//themeforest.net" type="text/html" style="width:100%;height:50em;" class="viewer" id="viewer">
<p>Sorry. This content cannot be rendered (non-IE object). Stop living in the past and upgrade to <a href="http://www.abetterbrowser.com">a better browser</a></p>
</object>
<!--<![endif]-->
<!--[if IE]>
<iframe src="//themeforest.net" type="text/html" style="width:100%;height:50em; border: 0" class="viewer" id="viewer">
<p>Sorry. This content cannot be rendered (IE iframe). Stop living in the past and upgrade to <a href="http://www.abetterbrowser.com">a better browser</a></p>
</iframe>
<![endif]-->
<script>
$(document).ready(function(){
$("#selector").change(function(){
$("#viewer").attr("src", $(this).val());
});
$("#selector").change(function(){
$("#viewer").attr("data", $(this).val());
});
});
</script>
Thanks