okay you had several issues in your code..
first of all.. it seems like you are not exactly sure what you are
doing.. maybe you should try to get the hang of jquery via some
tutorials and then try all this..
but i took your code and made some adjustments..
your javascript should look like this:
<script language="javascript" type="text/javascript">
$(document).ready(function(){
hideRepeats();
});
function hideRepeats(){
var saveWord = "";
$("#TestTable
td.noRepeat").each(function(){
var thisHtml = $(this).html();
var prevHtml = $(this).parent().prev().children
('.noRepeat').html();
if(prevHtml == thisHtml || saveWord ==
thisHtml){
$(this).html('');
}
if(saveWord == "") { saveWord =
thisHtml; }
if(saveWord != thisHtml) {
saveWord = ""};
});
}
</script>
and your table is wrong as well..
it should look like this..
<TR>
<TD class="noRepeat">abc</TD>
<TD>b</TD>
<TD>c</TD>
<TD>d</TD>
</TR>
and then the loader you have at the end.. it does not do anything,
cause you dont have a tableWrapper... so its not gonna do you any
good..
so just take your time and play with some of the jquery tutorials that
are out there.. i myself only started recently to work with jquery and
it took me a few days to get the hang out it.. but from your code
above i can see that you still need some time to learn all this..
On Sep 9, 11:17 am, Joe0855 <[email protected]> wrote:
> Thanks fichtre.diantre and Toby for your help. I don't get any error
> now but, the feature still doesn't work. Here is everything I'm doing
> with respect to the table (all contained within "results.php"):
>
> <HTML>
> <HEAD>
> <script type="text/javascript" src="../scripts/jquery-
> ui-1.7.2.custom/js/jquery-1.3.2.min.js"></script>
> <script type="text/javascript" src="../scripts/jquery-
> ui-1.7.2.custom/js/jquery-ui-1.7.2.custom.min.js"></script>
> <script language="javascript" type="text/javascript">
> function hideRepeats(){
> var thisHtml = $(this).find('.noRepeat').html();
> var prevHtml =
> $(this).parent().prev().find('.noRepeat').html();
> if(thisHtml == prevHtml){ $(this).find('.noRepeat').html('');
> }
> }
> </script>
> </HEAD>
>
> <BODY>
> <TABLE ID='TestTable' BORDER='0' BGCOLOR='#55AAFF'>
> <TR>
> <TD><h4>Store</h4></TD>
> <TD><h4>City</h4></TD>
> <TD><h4>State</h4></TD>
> <TD><h4>Zip Code</h4></TD>
> </TR>
>
> <?php
> While ($row = mysql_fetch_assoc($result))
> {
> echo "<TR onMouseOver=\"this.bgColor='#FFFF00'\" onMouseOut=
> \"this.bgColor='#55AAFF'\">";
> echo "<TD><h1>";
> echo $row["UserName"];
> echo "</h1></TD>";
> echo "<TD><h1>";
> echo $row["City"];
> echo "</h1></TD>";
> echo "<TD><h1>";
> echo $row["State"];
> echo "</h1></TD>";
> echo "<TD><h1>";
> echo $row["ZipCode"];
> echo "</h1></TD>";
> echo "</TR>";
> }
> echo "</table>";
> ?>
>
> <script language='javascript' type='text/javascript'>
> $('#tableWrapper').load("results.php?vars=TestTable", hideRepeats());
> </script>
> </BODY>
> </HTML>
>
> I've also tried moving the hideRepeats function call inside the PHP
> (as "echo" statements), but still no luck. I will keep trying other
> things. Thanks again for all you help!
>
> On Sep 8, 2:42 am, "fichtre.diantre" <[email protected]>
> wrote:
>
>
>
> > Hi,
>
> > you missed the '$' before your expression :
>
> > ('#tableWrapper').load(...
>
> > =>
>
> > $('#tableWrapper').load(...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---