SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    873
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not able to detect the space

    Dear All,
    I got a link this http://testsite1/mm/page1.php?tID=18&tSerial=TEST TT 1
    Then I got this codes
    var qs = location.search, positionID = qs.match(/tID=(\w+)/)[1],serialID = qs.match(/tSerial=(\w+)/)[1];
    My problem is that when tSerial is having space e.g. TEST TT 1 then my qs.match can not capture the space what changes must I perform here?

  2. #2
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by newtomysql View Post
    what changes must I perform here?
    Your regex needs to include a space in its pattern.


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
  •