I want to, when and edited iten is saved, to redirect to another page... i'm using the above code to change de source of the page. This causes the page to reload. No problem there...

    stringURL = stringURL.replace(stringURL.substring(stringURL.indexOf("Source="),stringURL.length),"Source="+_spPageContextInfo.webAbsoluteUrl+"/example.aspx?Code1="+code1.text()+"&code2="+code2);
    location.href = stringURL;

The problem is, when I hit the "save" button, evething after the & character just desapears.... it gives me a ulr like this:


If I just copy the url and paste, it works fine... but when I hit the save button, it sends me to


If I put an & before code1, it gets removed too.

I have nothing else handling the url after this. Don't know why this is happening

1 Answer 1


Changin the & on the url:


for %26


just solved my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.