混淆jquery帖子 [英] Confuse about jquery post

查看:59
本文介绍了混淆jquery帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将参数传递给jquery帖子,然后使用$ _POST方法获取它。但它不会这样工作



我有什么试过:



I am required to pass a parametre to jquery post and then get it using $_POST method .But it doesnt work this way

What I have tried:

<!doctype html>
<html lang="en">
<head>

  
  
</head>
<body>

<?php

$name = isset($_POST["name"]) ? "ok" : "error";
echo $name;


?>
<button type="button" id="getIt">Tıkla</button>



</body>
</html>


<script>

    $(document).ready(function(){
        $('#getIt').click(function () {
            $.post( "xx.php", {"name": "xxx"})

                });

    })
</script>

推荐答案

_POST方法。但它没有这种方式工作



我尝试了什么:



_POST method .But it doesnt work this way

What I have tried:

<!doctype html>
<html lang="en">
<head>

  
  
</head>
<body>

<?php


name = isset(
name = isset(


_POST [name])? ok:错误;
echo
_POST["name"]) ? "ok" : "error"; echo


这篇关于混淆jquery帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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