www.webdeveloper.com
Results 1 to 2 of 2

Thread: Jquery ajax ie/firefox puzzle

  1. #1
    Join Date
    Feb 2006
    Posts
    170

    Jquery ajax ie/firefox puzzle

    Hi,

    I've got an issue with the following jquery ajax code:

    It works fine in IE 7/8 but in Firefox/Chrome etc it fails and I get redirected.

    Any ideas? Bit of a newbie at AJAX stuff!

    Thanks for any help

    Code:
         
    var postto = "http://localhost:3000/blah"; 
         $.ajax({
           url: "/questiondata",
           type: "post",
           contentType: "application/json; charset=utf-8",
           data: $('#questionnaire_form').serialize(),
           dataType: "script",
           beforeSend: function(xhr){
               xhr.setRequestHeader("Accept","text/javascript");
           },
           success: function(data) {LoadQuestion(data)},
           error: function(data) {
                 location .href = "http://www.google.com";
                 }    
         });

  2. #2
    Join Date
    Jul 2009
    Posts
    62
    doesn't the URL need an extention like
    url: "/questiondata.htm"
    url: "/questiondata.php"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles