0

I'm using js code in webview but i'm getting error

Uncaught TypeError: $(...).datepicker is not a function

var imported = document.createElement('script');
                            imported.onload = function(){

                            html2canvas(document.querySelector("body > div.container-fluid > div > div > div:nth-child(3) > div > div > form > div:nth-child(2) > div > div > img"), {
                                        onrendered: function(canvas) {
                            var ctx=canvas.getContext("2d");
                            var w=canvas.width;
                            var h=canvas.height;
                              ctx.fillStyle = "#FFF";
                                ctx.fillRect(0, 0, w, h);
                              var cap =document.querySelector("body > div.container-fluid > div > div > div:nth-child(3) > div > div > form > div:nth-child(2) > div > div > img")
                              ctx.drawImage(cap,0,0);
                             var imgData=canvas.toDataURL('image/webp',1.0);
                            console.log(imgData);
                                           },
                                                   allowTaint: true,
                          taintTest: false
                                    });
                            }
                            imported.src = 'https://pastebin.com/raw/dRap1YD8';
                            document.head.appendChild(imported);

using it on this website to get the captcha image as dataUrl

The code working fine in another website but not in this one

NOTE: Pastebin is just temporary

Another Question: is this code contain jquery ?

user11845248
  • 131
  • 8

0 Answers0