Hi Tom,

I think you are missing dataType = 'html' ... The manual says "If none 
is specified, jQuery will intelligently pass either responseXML or 
responseText to your success callback, based on the MIME type of the 
response." I suspect it's intelligently guessing wrong.

This is a much easier way to do what you're trying to do:
$('#ccol24').load('addLinks.php',{ url: url, title: title });

If you need a further 'success' callback, you can add one as the third 
argument.
The only drawback to that shortcut is that you can't set an error callback.

Hope that helps.
-K


Tom Shafer wrote:
> I am trying to use ajax post to simply send a form field to php and
> return it to a div
> Here is what I have
> $(document).ready(function(){
>
>     $("#addLinks").submit(function() {
>         $.ajax({
>             url: 'addLinks.php',
>             type: 'POST',
>             data: {
>                 url: $("#url").val(),
>                 title: $("#title").val()
>             },
>             error: function () { alert('Error adding link'); },
>             success: function (data) { $("#contentcol4").append(data); }
>          })
>     });
>
> });
> the php file contains  <? echo $_POST['url'];?>
>
> i keep getting a error of
> This XML file does not appear to have any style information associated
> with it. The document tree is shown below.
>
> im not sure what to do, I am new to this
>
> Thanks

Reply via email to