This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Change html with jquery

Diegobolso93 wrote on 2013-03-16:
Hi, I want to download a actual page after I change some information with Jquery, the problem is that its generate the old html not thats one that I change with nw information:

I have this script:

$(".avatar-operador").attr("src","http://www.xxx.com/galeria/usuarios/"+data['imagen'])
$("#master_wrapper").css("background","none")
$("body").css("background-color","#FFFFFF")
var URL= "http://pdfcrowd.com/url_to_pdf/?width=500mm&height=200mm";
window.location = URL;


But it generate me the old page..
support wrote on 2013-03-18:
Hello,

It is not possible to capture such local HTML document change.

Let us know what is your goal. Maybe there exists another solution for what you want to achieve.
Diegobolso93 wrote on 2013-03-20:
I´m using a mvc framework so I bring the information from the controller and there I have
two variables that contains information retrieve by cookies and then when I generate the pdf its show me php errors relationate to that cookies but at the website works good..


Why happen that?
support wrote on 2013-03-21:
Hello,

Please let us know a link to your web page that exhibits the problem and we will look into it. Also please post here the part of your application code where you call the API.
Diegobolso93 wrote on 2013-03-21:
Look I resolve it but how I can ajust to can print this good ?

http://www.locheco.com/programa/Descargar/2/2/32 , press the button "Descargar Programa"
support wrote on 2013-03-22:
Try to change the link to:
http://pdfcrowd.com/url_to_pdf/?width=14.7in&height=19in
Diegobolso93 wrote on 2013-03-22:
But it have to be variable..look how I calculate it and then depends on it I multiplicate it:

var words = $('#wrapper-960').text().split(' ').length;
var alto=words*0.010416667;
alto=alto*2;
alto=alto.toFixed();
var URL= "http://pdfcrowd.com/url_to_pdf/?width="+alto+"in&height="+alto+"in";
$("#descarga").attr("href",URL)
support wrote on 2013-03-26:
Hello,

Well, calculating the width and the height from the number of words in the document is a bit heuristic and it will not work in all cases.

I would suggest to use always the same page width (14.7in) and then somehow calculate the page height
Diegobolso93 wrote on 2013-04-01:
How I can make more friendly to print this webpage..

http://www.locheco.com/programa/Descargar/2/2/7 ?