热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

网页不显示发布的数据-Webpagedoesn'tdisplayposteddata

Ihaveatable(ImusingDataTablesplug-inforjQuery)andwhenIclickonarowIwanttobered


I have a table (I'm using DataTables plug-in for jQuery) and when I click on a row I want to be redirected to another page where will be displayed customer details.

Here is my code in customers.php file:

我有一个表(我正在使用jQuery的DataTables插件),当我点击一行时,我想重定向到另一个页面,在那里将显示客户详细信息。这是我在customers.php文件中的代码:


This is in customer_details.php file

这是在customer_details.php文件中

Company name

When I click on a row I am redirected to customer details page but I can't see the data (i.e. name). When I look at response tab in console in Firebug I can see this data in div.
Could anyone help me what am I doing wrong?

当我点击一行时,我被重定向到客户详细信息页面,但我看不到数据(即名称)。当我在Firebug中查看控制台中的响应选项卡时,我可以在div中看到这些数据。谁能帮助我,我做错了什么?

1 个解决方案

#1


1  

AJAX is used to get data into an already loaded page without having to re-load.

AJAX用于将数据导入已加载的页面,而无需重新加载。

What the current code does is, first, it sends ajax POST request to the customer_details.php page. What this ajax request does is get the results from the POST request using a XMLHttpRequest object.
(You can read up on it here: http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp)

当前代码的作用是,首先,它将ajax POST请求发送到customer_details.php页面。这个ajax请求的作用是使用XMLHttpRequest对象从POST请求中获取结果。 (你可以在这里阅读:http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp)

Then, you redirect the browser to that page.

然后,您将浏览器重定向到该页面。

What you want to do instead is send a POST request using a form.
(This question has a good explanation how you would accomplish it: Javascript post request like a form submit)

您要做的是使用表单发送POST请求。 (这个问题很好地解释了你将如何实现它:像表单提交的Javascript发布请求)


推荐阅读
author-avatar
iz76mww
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有