2

The DataTables search is not working in Chrome. My code works fine in Firefox.

I checked the Chrome console: Uncaught TypeError: Property 'getItem' of object #<Object> is not a function

This is my code:

html:

<table class="table-announcement" id="announcement">
<thead>
    <tr>
        <th class="header">Announcement</th>
        <th class="header">Date</th>
        <th class="header">Posted by</th>
    </tr>
</thead>
<tbody>
<?php foreach ($announcement as $post): ?>
    <?php $msg = "'<h1>" . $post['title'] . "</h1><h2>by: " . $post['username'] . "</h2><br/>" . str_replace("\r\n", "", nl2br(htmlspecialchars($post['body']))) . "'";?>
     <tr>
         <td><a href="javascript:;" class="prompt" onclick="$.prompt(<?php echo $msg;?>)"><?php echo $post['title'];?></a></td>
         <td><?php echo $post['date'];?></td>
         <td><?php echo $post['username'];?></td>
     </tr>
<?php endforeach;?>
</tbody>

This is the jQuery:

$(document).ready( function () {
    $('#announcement').dataTable();
    $('#user').dataTable();
    $('#school').dataTable();
} );

Turns out this code works without any weirdness:

-(void)slideTableViewOffScreen
{
    CGRect newFrame = stageSelectionTable.frame;
    newFrame.origin.x -= 130;

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    [UIView setAnimationDelegate:self];

    stageSelectionTable.frame = newFrame;

    [UIView commitAnimations];
}
4

0 に答える 0