IE Mystery点击事件重新加载IFRAME

时间:2014-03-19 18:50:29

标签: javascript php jquery internet-explorer iframe

我在加载到IFRAME的页面上有一个表,它在调用URL中有一个GET查询字符串来指示正确的表数据。另外,我有一个jQuery系统,它可以更新表格的单元格,也可以将数据发布到PHP脚本来更新数据库。

在FF和Chrome上,更新按要求进行,表格单元格文本根据jQuery正确更新。没问题。

在IE上,在运行脚本并更新数据后,浏览器使用没有查询字符串的URL重新加载IFRAME内容(这显然会破坏显示。)IE的Web Developer Network Monitor显示IFRAME页面请求并声明它是通过单击超链接发起的(显然没有发生)。

更新 在使用Cookie进一步测试以保留查询字符串数据时,帖子中的某些内容似乎会导致整个帧重新加载。我评论了案例中的所有代码" 11"部分只发布帖子。还在重装。

为什么IE会点击这个'点击'重新加载页面的事件,为什么它只使用URL的无字符串查询部分?

这是脚本的一部分,它将我的更改发布到PHP脚本并使用新数据更新表格单元格(原谅我的烂摊子,仍在开发中)

//Beginning here, the code attaches the change handler to a dynamically generated input or select form element
//The 'cell' element below is a cache of an earlier element (the original table cell)
$('#updForm').on('change','input, select', function() {
       updCell = $(this);
       //POST data to ajax.php for update and audit logging
       $.post('/inc/ajax.php',{
            'called': 'stdUpdate',
            'type': type,
            'field': name,
            'idx': record,
            'table': table,
            'value': updCell.val().trim().toUpperCase()
       }, function(data){
                switch (data){
                     case "10": alert('Updated the record, but the audit logging failed.'); break;
                     case "01": alert('Did not report an updated record, but the audit logged the transaction.'); break;
                     case "00": alert('No records were updated or logged.'); break;
                     case "11":
                          cell.text(updCell.val().trim().toUpperCase());
                          $('tbody tr:eq(' + rowId + ') td:eq(' + colId + ')').text(updCell.val().trim().toUpperCase());
                          //Resize row if height increased
                          $('table.DTFC_Cloned tbody tr:eq(' + rowId + '), tbody tr:eq(' + rowId + ')').height(cell.height());  
                          //Resize column if width increased
                          $('table.DTFC_Cloned thead th.' + name + ', tbody th.' + name).width(cell.width());  
                          //Close the dialog and clear the dynamic section
                          $('#table-updater').dialog('close');
                          cell.css({
                             'background-color' : '#c6efce',
                             'color' : '#006100'  
                          }).animate({
                             'background-color' : 'transparent',
                             'color' : 'black'  
                          }, 1000);
                          $('#updForm').off('change','input, select');
                          $('#updForm').html('');
                          break;
                     default: alert('An invalid response of "' + data + '" was returned from the database.');          
                }
           });
      });

0 个答案:

没有答案
相关问题