Passing JSON data in the URL with AutoSuggest

Paolo's Avatar

Paolo

14 Jul, 2011 03:40 PM

Hi

I need to get my ajax search URL to look like this:
http://www.mySite.com/ajaxProxy.cfc?jsonData={q:'blondes'}

But from what I can see the only way to send the data currently is:
http://www.mySite.com/ajaxProxy.cfc?q=blondes

My AjaxProxy class forces the jsonData package to be sent and in that format.

How do I customise the way the url is constructed? It is the = sign that is causing me not to be able to do what I need to do when I use the queryParam option.

For example:

$("#albumTags").autoSuggest("http://www.mySite.com/ajaxProxy.cfc", { minChars: 2,
matchCase: true,
queryParam: "jsonData={q:'",
extraParams: "'}" });

This comes out as the url below, which is incorrect due to the = sign.
http://www.mySite.com/ajaxProxy.cfc?jsonData={q:'=blondes'}

Any ideas? I'm really stumped. If I could just get rid of the = sign that would help.
Or better yet, execute this with an ajax post instead of via a URL.
Thanks

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac