Forum Moderators: open

Message Too Old, No Replies

strange behavior with WebKit (Safari/Chrome)

ajax doesn't translate properly in ajax request

         

pedalpete

1:03 am on Nov 14, 2008 (gmt 0)

10+ Year Member



I have had this issue for a while, and have been unable to resolve it.

I have a genre field on my website to filter a list of concerts.
In IE and FireFox, selecting returns results with the selected genre.
In Safari & Chrome, specifically multi-word genres (like 'hip hop' or 'roots music') does not return any results.

I've checked that the variable is being passed correctly, and it is. I can output the sql and then put that directly into my sql and I get a result.

The only thing I can think of is that WebKit is adding some sort of hidden special character where a space exists.
The reason I say that is I have put into my server-side code a check for spaces.
When a genre with a space is requested in IE and Firefox, that check is triggered. The check is not triggered in Safari/Chrome (hence why I think it is a webkit issue).

I've also checked for the usual suspects "&nbsp, +, &#160'.
Anybody here know why this would be happening? I've been searching for a solution for weeks and am getting nowhere.

Phate

12:07 am on Nov 22, 2008 (gmt 0)

10+ Year Member



Since no one else has replied and I had the same issue.

In my case I found safari to be replacing the standard space character with the character %a0 I used javascript to strip it out

value =value.replace(/\xA0/,'');

pedalpete

12:19 am on Nov 22, 2008 (gmt 0)

10+ Year Member



thanks Phate,

actually just a few days ago i realized it was /\W/g as the special character which also seems to act as a space.
Though in my case it was a jquery plug-in which was adding that space in, not WebKit itself.