jquery - javascript windows.location string picking -
i have url:
http://localhost/estamo/asset.php?aname=vklqifbsyxph&di=ng==
and need using javascript
var locat = window.location.href; $.get("enviaramigo.php?email="+$("#email").val()+"&url="+locat, function(html) {
but, when use locat var, incomplete url:
http://localhost/estamo/asset.php?aname=vklqifbsyxph
how complete url?
thanks
you need encode url using encodeuricomponent
var locat = window.location.href; $.get("enviaramigo.php?email="+$("#email").val()+"&url="+encodeuricomponent(locat), function(html) {
or base64
$.get("enviaramigo.php?email="+$("#email").val()+"&url="+btoa(locat), function(html) {
and need decode on sever.
Comments
Post a Comment