.post works as expected with IE but not with Safari and FF
Hi all,
I'm wondering why my code works fine with IE8 and IE7 but failes to work with Safari and FireFox.
HTML (requester)
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=windows-1250">
- <meta name="generator" content="PSPad editor, www.pspad.com">
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript">
- var ajxFile = "ajx.php";
- function send(){
- $.post(ajxFile,$('form#form1').serialize(),
- function(rdata){
- $('#ergebnis').html(rdata);
- }
- )
- };
- </script>
- <title>AJAX Test</title>
- </head>
- <body>
- My little AJAX test<br>
- <div id='d1'>
- <form id="form1" method="post" action="">
- <input name='f1' type='hidden' value='4711'>
- Please enter a number:<br>
- <input name="zahl1" type="text" id="zahl1" size="8">
- <br>
- <br>
- Please enter some text:<br>
- <input name="text1" type="text" id="text1" size="30">
- <br>
- <br>
- Favorite color?<br>
- <input type="radio" name="radio" id="red" value="red">red
- <br>
- <input type="radio" name="radio" id="green" value="green">green
- <br>
- <input type="radio" name="radio" id="blue" value="blue">blue
- <br>
- <input type="radio" name="radio" id="yellow" value="yellow">yellow
- <br>
- <br>
- <button onclick='send()' >Send</button>
- <br>
- Response: <br><span id="ergebnis">No response yet</span>
- </form></div>
- <br></body>
- </html>
The called PHP file (ajx.php) is quite simple:
- <?php
- $ajxData = $_POST;
- echo "<pre>".print_r($ajxData,TRUE)."</pre>";
- ?>
What's wrong with this? Wy didn't neither Safari nor Firefox show the response from PHP if there is one?
Thanks
Gunter