I am using html2canvas js but not be Screenshot Capture by page url
Loading
I am using html2canvas js but not be Screenshot Capture by page url
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mithilesh TataPosted Feb 29, 2024, 7:35 AM
To take a screenshot of a webpage URL using jQuery and PHP, you can use a combination of client-side and server-side code. Here's a basic approach:
Client-Side (jQuery): Use jQuery to send an AJAX request to the server with the URL of the webpage to capture the screenshot.
Server-Side (PHP): Use PHP to capture the screenshot of the webpage URL using a headless browser or a third-party service like Puppeteer or PhantomJS.
Below is an example implementation:
Client-Side (jQuery):
Server-Side (PHP -
capture.php):In this example, when the user enters a URL and clicks the "Capture Screenshot" button, jQuery sends an AJAX POST request to
capture.phpalong with the URL. The PHP script then captures the screenshot of the provided URL (you need to implement this part using a headless browser or a third-party service), and returns the screenshot data back to the client.Please note that capturing a screenshot using headless browsers or third-party services might require additional setup and configuration. Ensure that you have the necessary permissions and resources to execute such tasks on your server. Additionally, consider security implications and handle user inputs appropriately to prevent security vulnerabilities like XSS (Cross-Site Scripting) attacks.