将值从一页传递到另一页,而无需表单且不传递URL [英] Pass values from one page to another without form and without passing in URL

查看:56
本文介绍了将值从一页传递到另一页,而无需表单且不传递URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个需要始终访问干净URL的项目,即无法在URL中传递参数以获取另一页上的值.

I am working on a project where i need to access clean URL's always i.e no parameters can be passed in the URL for getting values on another page.

除了表单提交"方法外,任何人都可以提出其他建议.

Can anyone please suggest an alternative other than 'Form Submit' method.

谢谢.

推荐答案

对于Clean URL,我希望您可以使用 HTTP POST 方法.希望有帮助.

For Clean URL's i prefer you may use HTTP POST Method. Hope that helps.

<form name="frmApp" method="POST" action="/action.php">
</form>

否则,您可以将 AJAX jQuery 一起使用,以将值提交到另一个页面.

Else, you can use AJAX with jQuery to submit the values to another page.

$.ajax({url:"action.php",success:function(result){
  $("div").html(result);
}}); 

查看w3schools来开始使用AJAX: http://www.w3schools.com/jquery /jquery_ajax.asp

Check out w3schools to get started with AJAX : http://www.w3schools.com/jquery/jquery_ajax.asp

不支持 SESSION ,因为我不喜欢在网页内编写 php 代码.

No support for SESSION since i don't like writing php code inside my web page.

这篇关于将值从一页传递到另一页,而无需表单且不传递URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆