Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to run a javascript function loaded using jquery .load
    text
    copied!<p>i googled and searched here to but unable to figure it out my script is not working</p> <p>i'm loading a html file using .load function file loaded successfully but javascirpt in is not working when i view that file in browser all works..</p> <p>below function is loading html file</p> <pre><code>function loadPage(page, pageElement) { $(pageElement).load('pages/page' + page + '.html'); //loadRegions(page, pageElement);} </code></pre> <p>this is the function in ajax loaded html file </p> <p><code> addLoadEvent(load1); </code></p> <p>script is generated by pdftohtml script that generate canvas... i can't attach it to any event like click .. can it work as it is...</p> <p><strong>pdftohtml generate script</strong></p> <pre> function adjustCharSpacing(el,actualWidth) { var rawWidth=el.offsetWidth; if(actualWidth>20 & rawWidth!=actualWidth && actualWidth>rawWidth){ var spacing= 0; var s=spacing+'px'; el.style.charSpacing = s; rawWidth=el.offsetWidth; var diff=rawWidth-actualWidth; if(diff20 && actualWidth>rawWidth && rawWidth!=actualWidth & el.textContent.search(' ') > -1){ var spacing= 0; var s=spacing+'px'; el.style.wordSpacing = s; rawWidth=el.offsetWidth; var diff=rawWidth-actualWidth; if(diff12 & rawWidth>5 & rawWidth!=actualWidth){ if(rawWidth>actualWidth){ while (rawWidth>actualWidth & lastRawWidth!=rawWidth){ pixelSize--; el.style.fontSize = pixelSize+'px'; lastRawWidth=rawWidth; rawWidth=el.offsetWidth; } var lastDiff=lastRawWidth-actualWidth; var nextDiff=actualWidth-rawWidth; if(lastDiff5) el.style.fontSize = pixelSize+'px'; else el.style.fontSize = rawFontSize+'px'; if(pixelSize!=el.style.fontSize){ adjustCharSpacing(el,actualWidth); adjustWordSpacing(el,actualWidth); } } } var pdf; function M(a,b){pdf.moveTo(a,b);} function L(a,b){pdf.lineTo(a,b);} function C(a,b,c,d,e,f){pdf.bezierCurveTo(a,b,c,d,e,f);} function Q(a,b,c,d){pdf.quadraticCurveTo(a,b,c,d);} function BP(){pdf.beginPath();} function CP(){pdf.closePath();} function LW(a){pdf.lineWidth=a;} function LC(a){pdf.lineCap=a;} function LJ(a){pdf.lineJoin=a;} function ML(a){pdf.miterLimit=a;} function SS(a){pdf.strokeStyle=a;} function ST(){pdf.stroke();} function GA(a){pdf.globalAlpha=a;} function FS(a){pdf.fillStyle=a;} function FI(){pdf.fill();} function CL(){pdf.clip();} function SV(){pdf.save();} function RS(){pdf.restore();} var loaded1 = false; var assetsLoaded1 = 0; var assetCount1 = 20; var images1 = new Array(); var imageCount1 = 20; function load1(){ if (!loaded1) { loaded1=true; document.getElementsByClassName("l1")[0].innerHTML = "Loading Assets..."; for (var i = 1; i </pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload