简体   繁体   English

jQuery datatables断开页面上的链接

[英]jquery datatables breaking links on page

http://pytools.webfactional.com/capstoneTemp/ http://pytools.webfactional.com/capstoneTemp/

so I've implemented jquery datatables here on this example using a php serverside processing file which is pulling the data from mysql. 因此,在此示例中,我使用php服务器端处理文件(从mysql提取数据)实现了jquery数据表。 probably not really relevant at all but i thought id share that info. 可能根本不相关,但我认为id可以共享该信息。 the problem i'm having is as follows: 我遇到的问题如下:

the Sign-in button used to work. 登录按钮即可正常工作。 now it just reloads the same index page. 现在,它只是重新加载了相同的索引页。 when I manually type in the address that it shows when I hover over the link, 当我手动输入将鼠标悬停在链接上时显示的地址时,

http://pytools.webfactional.com/capstoneTemp/signIn.html http://pytools.webfactional.com/capstoneTemp/signIn.html

this page loads. 此页面加载。 but when i click it just reloads the index.html page and appends a "?" 但是,当我单击它时,它将重新加载index.html页面并附加一个“?” to the URL. URL。 I played with the javascript at the bottom of the body which is as follows: 我在主体底部使用了JavaScript,如下所示:

<script src="js/jquery-1.11.0.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-switch.js"></script>
  <script src="js/DataTables.js"></script>
  <script src="js/jquery.dataTables.js"></script>
<script>
    $( document ).ready(function() {
        $('#login').submit(function(){
        console.log($(this));
            return false;
        });
        $('#prettyTable').dataTable({
            "aLengthMenu": [[5,10, 25, 50, -1], [5,10, 25, 50, "All"]],
            "iDisplayLength" : 10,
            "bProcessing": true,
            "bServerSide": true,
            "sAjaxSource": "listOwners2.php"
        });


    });
</script>

whats really bothering me is I've used datatables before in another assignment, and didn't have any issues like this, as demonstrated here 真正困扰我的是,我之前在另一项作业中使用过数据表,并且没有像这样的问题,如此处所示

http://collegedata.pytools.webfactional.com/question9 http://collegedata.pytools.webfactional.com/question9

in this page the navigation links still work. 在此页面中,导航链接仍然有效。

HOW CAN I GET TO THE SIGN-IN PAGE FOR MY PHP app?? 我如何进入我的PHP应用程序的登录页面?

Actually the button should do nothing, as it's not linked to JavaScript event. 实际上,按钮不应该执行任何操作,因为它没有链接到JavaScript事件。 Change it too: 也更改它:

<a class="btn btn-primary" href="http://pytools.webfactional.com/capstoneTemp/signIn.html">Sign-In..</a>

Adding button styles to HTML anchors is valid in Bootstrap. 在Bootstrap中将按钮样式添加到HTML锚是有效的。 It will give you the same layout. 它将为您提供相同的布局。

Or wrap the HTML anchor with the button not the opposite, but the first approach is more valid! 或使用按钮包装HTML锚点,而不是相反,但是第一种方法更有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM