I am learning how to cange my URL to show query string parameters sent to server
I am taking some data from user, making an ajax call to server, when server returns data i show that to user,,, So, if my URL earlier was abc.com . and If I use pushstate to append query string parameters to URL i.e. to make it abc.com?param1=val1¶m2=val2 ,
Would this new URL be the actual URL for those 2 parameters taken from user. I mean If I copy and send this link to somebody : abc.com?param1=val1¶m2=val2
would it open that abc.com to show data results for these two parameters?
Thanks in advanceenter code here
It does not get the data for for
abc.com?param1=val1¶m2=val2
but instead gets data forabc.com
, the defaultBut you can fix this either using JS or Server-side prog lang.
document.URL
yourself and then load the data based on the params. (Not recommended)abc.com?param1=val1¶m2=val2
The second method is highly recommended.