SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,813
    Mentioned
    141 Post(s)
    Tagged
    0 Thread(s)
    Yes you can. JavaScript won't care. You can simply perform window.location.href = 'build your url here with the query string';


Tags for this Thread

Bookmarks

Posting Permissions

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