Url modification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kierandes
    New Member
    • Apr 2008
    • 25

    Url modification

    Hi guys,
    I was just wondering if there is a way to append a url with a variable using ajax or javascript. I know of a way to do it with php, but I am trying to get a client side means of doing this job. (creating a site search and append search variables to the end of a url).

    The reason I am doing or trying to at least do a ajax version is I am aware of how the search may be slowed down by multiple users of the server if I was to use php (multiple searches may flood the server).

    for example in php you can post the search string and echo it to where you like (thanks to the guys in the php side that helped me, A+)
    Is there a similar means with ajax?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    If you want to lighten the load on the server, then Ajax isn't going to help because it will use PHP (in your case). Unless I've missed something and you only need to change the URL, then you can do it with JavaScript only:
    [code=javascript]window.location .href += "?whatever you want to add";[/code]

    Comment

    • kierandes
      New Member
      • Apr 2008
      • 25

      #3
      thanks for your reply. I will look into what you suggested. I think I'm probably over thinking it :)

      Comment

      Working...