首页 \ 问答 \ 在重定向页面之前获取新创建的记录ID(Get newly created id of a record before redirecting page)

在重定向页面之前获取新创建的记录ID(Get newly created id of a record before redirecting page)

当我点击保存按钮并在重定向页面之前,我想使用javascript检索新创建的记录的ID。

你有什么想法吗?

谢谢 !


I would like to retrieve the id of a newly created record using javascript when I click on save button and just before redirecting page.

Do you have any idea please ?

Thank you !


原文:https://stackoverflow.com/questions/44590796
更新时间:2024-02-28 15:02

最满意答案

我发现这个答案http://www.mpdf1.com/forum/discussion/621/margin-top-problems/p1基本上报告我的问题。 解决方案是添加页面并将其删除,以便代码计算页边距,然后再次添加页面。

$this->mPDF->WriteHTML($html);
$this->mPDF->page = 0;
$this->mPDF->state = 0;
unset($this->mPDF->pages[0]);

I found out this answer http://www.mpdf1.com/forum/discussion/621/margin-top-problems/p1 which basically reports my issue. The solution is to add a page and delete it so the code calculates the margins and then add again the page.

$this->mPDF->WriteHTML($html);
$this->mPDF->page = 0;
$this->mPDF->state = 0;
unset($this->mPDF->pages[0]);

相关问答

更多
  • mPDF使用自动调整表,这也影响字体大小。 当使用mPDF输出表时,您需要设置: 在每张桌子上。 请参阅mPDF手册中的自动布局算法以供参考。 mPDF uses autosizing tables and this influences, among other things, the font-size as well. When outputting tables with mPDF you need to set:
  • mPDF不支持body元素上的id 。 从css选择器中删除body#the_pdf和body#the_pdf ,将应用您的样式。 当我添加例如时,正确应用样式表中的其他Bootstrap样式(特别是font-family )。 示例代码的标题和段落。 请参阅mPDF在线手册中有关支持的HTML属性的页面。 mPDF does not support id on body element. Remove body#the_pdf and body#the_pdf from your css selector ...
  • Remove your and put this code. Remove your
  • 所以正在发生的事情是你试图将数字除以0,这是行不通的! 数学不允许这样做。 (例如5 / 0 = ? -> ? * 0 = 5 ) 作为一个例子这一行: $ratio = $actual_h / $use_w; 你得到一个错误,因为$use_w是0! 那么你如何防止这些错误呢? 你可以这样检查一下: if($use_w != 0) { //Here you could end the script OR assign it to 1, just make sure you never use $u ...
  • 已修复它,似乎有一些来自mpdf库的错误报告,Fat-free框架不接受。 在顶部添加这个解决了一切 error_reporting(0); Already fixed it, seems like there's some kind of error reporting coming from the mpdf library that Fat-free framework doesn't accept. Adding this at the top solved everything error_r ...
  • 我发现这个答案http://www.mpdf1.com/forum/discussion/621/margin-top-problems/p1基本上报告我的问题。 解决方案是添加页面并将其删除,以便代码计算页边距,然后再次添加页面。 $this->mPDF->WriteHTML($html); $this->mPDF->page = 0; $this->mPDF->state = 0; unset($this->mPDF->pages[0]); I found out this answer http:/ ...
  • 。 MPDF会将
    内的内容缩小为o Please use
    instead of using . MPDF will shrink the content inside
    to o
  • 如何使用AngularJS下载二进制文件 下载二进制文件时,设置responseType非常重要: $http({ url: 'http://localhost:8080/services/generatePDF?uniqueID=INV0005', //SET responseType responseType: 'blob', method: 'GET', headers: { 'securityToken': '123', 'Co ...
  • 你必须检查你的PHP版本。 检查是否支持mpdf到您当前的PHP版本。 查看此更改日志文件并检查是否使用了任何已弃用的函数。 https://github.com/mpdf/mpdf/blob/v6.1.0/CHANGELOG.txt You have to check your PHP version. Check that mpdf is supported or not to your current PHP version. Look into this change log file and ch ...