javascript - Ajax - maintaining state in the url - no # -


i working on ajax website there 2 search parameters. did mod-rewrite , checking $_get variables can like..

site.com/var1/var2/ -> automatically search based on parameters.

now want people search manually, able have url in format. method i've been able find has w/modifying url using..

location.hash = 'foo';

which make like.. site.com/#var1

which isn't nice mod-rewrite. have found works if in search function ajax call have code

     // avoid appending further variables if there variables      if(location.href == 'some absolute website path')         location.href = var1+'/'+var2+'/'; 

this work, forces page load , auto search php/javascript kick in due mod-rewrite. works, involves page refresh rather avoid.

any better solutions out there? ideally if able use location.href didn't cause page load once change value, change in url ideal (while maintaining mod-rewrite links, w/out # marks).

i using jquery , php.

it's way design, there no way yo change url or path without causing new request. regards.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -