#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    8
    Rep Power
    0

    Building query strings with javascript


    I am wondering if it is possible to build a query string like:

    fq=model:book+model:cds+model:journal+model:new_member+model:member

    I want to use the below in the browser’s address bar:

    //localhost:8080/search/q=son&fq=model:book+model:cds+model:journal+model:new_member+model:member

    I don’t want to use the “=” (model=book) and “&” (model=book&model=cds) signs, but I need pair values (model:book) and the “+” sign (model:book+model:cds).

    Thank you in advance,
    Tom
  2. #2
  3. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Aug 2005
    Location
    Bucharest ROMANIA
    Posts
    2,524
    Rep Power
    609
    Special characters should be encoded if they need to be sent within a query. See: encodeURIComponent

    Comments on this post

    • Skipt disagrees : hi

IMN logo majestic logo threadwatch logo seochat tools logo