Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return null in ajax [closed]
- <script type="text/javascript">
- $(document).ready(function() {
- function doAjax(url) {
- $("#customForm").submit(function() {
- var formdata = $("#customForm").serializeArray();
- $.ajax({
- url: url,
- type: "post",
- dataType: "json",
- data: formdata,
- success: function(data) {
- switch (data.livre) {
- case 'tituloLivre':
- $("#msgbox2").fadeTo(200, 0.1, function() {
- $(this).html('error').fadeTo(900, 1);
- });
- break;
- default:
- $("#msgbox2").fadeTo(200, 0.1, function() {
- $(this).html('success!').fadeTo(900, 1, function() {
- $('#conteudo').load('test.php'); // show NULL and must be programmer
- });
- });
- break;
- }
- }
- });
- return false;
- });
- }
- doAjax('sent.php');
- doAjax('dojo/test.php');
- });
- </script>
- <?php
- include ('includesMy.php');
- $form = $_POST['item'];
- $oferta = $form['oferta'];
- var_dump($oferta);
- ?>
- item[oferta] programmer
Add Comment
Please, Sign In to add comment