Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
document.addEventListener('wpcf7submit', function(event) {
var websiteUrl = event.detail.inputs['website_url'].value; // Get the URL from the form
if (!websiteUrl) {
alert("Please enter a website URL.");
return;
}
// Send the URL to the Flask API for SEO score
fetch('https://yourdomain.com/seo_checker/get-seo-score', {
method: 'POST',
body: new URLSearchParams({
'website_url': websiteUrl
})
})
.then(response => response.json())
.then(data => {
if (data.score) {
let resultHTML = `
Your SEO Score: ${data.score}
`;
for (const [key, value] of Object.entries(data.breakdown)) {
resultHTML += `