NetTalk Central

Author Topic: AJAX request always sets text/xml in ReplyContentType  (Read 3212 times)

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
AJAX request always sets text/xml in ReplyContentType
« on: June 18, 2011, 08:26:30 AM »
(handcoded NetWebPage)

In the Header routine the following code is what I see . . .

  p_web.ReplyContentType = 'text/html; charset=utf-8'
  p_web.ParseHTML(packet,1,0,Net:SendHeader+Net:DontCache)


But: text/xml is set in the response headers. . .

I just want to return 'OK' to the JQuery Form Plugin.
Just 2 letters 'OK' - no xml.
But it gives me the following error . . .

XML Parsing Error: syntax error Location: moz-nullprincipal:{5c54f1ad-9227-4ca9-8e06-27b87dfcb9f1} Line Number 1, Column 1:
OK
^


I think because of the text/xml in the response headers. . .

Anybody an idea?

regards

Patrick De Laet

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
Re: AJAX request always sets text/xml in ReplyContentType
« Reply #1 on: June 18, 2011, 12:48:25 PM »
I've found it hardcoded in NetWeb.clw - parseHTML procedure

When I change it to . . .

  If self.RequestAjax = 1
    self.ReplyContentType = 'text/html; charset=utf-8'
  end

. . . my JQuery Form Ajax request works now.
But permanently modifying NetWeb.clw is of course not an option.

Anybody another idea?

regards

Patrick De Laet

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: AJAX request always sets text/xml in ReplyContentType
« Reply #2 on: June 19, 2011, 08:04:51 AM »
You're right, don't edit the netweb.clw rather embed in webhandler. I think probably in CreateHeader.

Let me know if you need more.

Cheers
Bruce