I have a jsf application, and the rendered html has a radio button group that
essentially looks like this :
<script src="javascript/jquery-1.2.1.js"></script>
<script language="JavaScript">
<!--
jQuery.noConflict();
jQuery(document).ready(function(){
        jQuery(":radio").css({"background":"#003366", "border":"none"});

});
.
.
//-->
</script>
.
.
<table id="buttonsForm:filterByActor" style="margin: 0px 0px 0px 15px;
font-size: 12px; background-color: #003366;">
  <tr>
    <td><input type="radio" checked="checked"
name="buttonsForm:filterByActor" id="buttonsForm:filterByActor:0" value="Y"
/>
      <label for="buttonsForm:filterByActor:0"> My Cases</label></td>
    <td><input type="radio" name="buttonsForm:filterByActor"
id="buttonsForm:filterByActor:1" value="N" />
      <label for="buttonsForm:filterByActor:1"> All Cases</label></td>
  </tr>
</table>

I wish to hide/show the above table depending on what is rendered in my
iframe, so I used jquery in the header of the content that is rendered. 

Here is the jquery script for the content in the iframe when I wish to show
the table:
<script src="javascript/jquery-1.2.1.js"></script>
<script language="JavaScript">
<!--
jQuery.noConflict();
jQuery(document).ready(function(){

parent.document.getElementById("buttonsForm:filterByActor").style.display="block"
//jQuery("#buttonsForm:filterByActor",
parent.document).css({"display":"block"});

});
//-->
</script>

Here is the jquery script for the content in the iframe when I wish to hide
the table:
<script src="javascript/jquery-1.2.1.js"></script>
<script language="JavaScript">
<!--
jQuery.noConflict();
jQuery(document).ready(function(){

parent.document.getElementById("buttonsForm:filterByActor").style.display="none"
//jQuery("#buttonsForm:filterByActor",
parent.document).css({"display":"none"});

});
//-->

The issue is that the jquery script that is commented out does not work, BUT
the standard javascript code DOES WORK - why?!?!  What am I doing wrong? Is
there a better way to do this?




-- 
View this message in context: 
http://www.nabble.com/jquery-newbie---why-does-this-code-not-work--tp14539177s27240p14539177.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to