{"id":4245,"date":"2023-09-18T06:47:46","date_gmt":"2023-09-18T06:47:46","guid":{"rendered":"https:\/\/www.adlift.com\/in\/?page_id=4245"},"modified":"2026-07-24T08:20:09","modified_gmt":"2026-07-24T08:20:09","slug":"source-code-viewer","status":"publish","type":"page","link":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/","title":{"rendered":"Source Code Viewer"},"content":{"rendered":"<script data-no-optimize=\"1\" data-cfasync=\"false\">\nif (typeof seoToolsAjax === \"undefined\") { var seoToolsAjax = { ajaxurl: \"https:\/\/www.adlift.com\/in\/wp-admin\/admin-ajax.php\", nonce: \"c4526fd4d8\" }; }\nif (typeof window.SEOTools === \"undefined\") {\n    window.SEOTools = {\n        ajaxRequest: function (tool, data, successCallback, errorCallback) {\n            data.action = \"seo_tool_action\";\n            data.tool = tool;\n            if (typeof seoToolsAjax !== \"undefined\" && seoToolsAjax.nonce) { data.nonce = seoToolsAjax.nonce; }\n            var ajaxUrl = (typeof seoToolsAjax !== \"undefined\" && seoToolsAjax.ajaxurl) ? seoToolsAjax.ajaxurl : \"\/wp-admin\/admin-ajax.php\";\n            var $ = window.jQuery || window.$;\n            if ($) {\n                $.ajax({\n                    url: ajaxUrl, type: \"POST\", data: data, timeout: 120000,\n                    success: function (res) { if (res.success) { if (successCallback) successCallback(res.data); } else { if (errorCallback) errorCallback(res.data || \"An error occurred\"); } },\n                    error: function (xhr, status, error) { if (errorCallback) errorCallback(\"Request failed: \" + error); }\n                });\n            } else {\n                var formData = new FormData(); for (var k in data) formData.append(k, data[k]);\n                fetch(ajaxUrl, { method: \"POST\", body: formData }).then(function(r){ return r.json(); }).then(function(res){ if(res.success){ if(successCallback) successCallback(res.data); }else{ if(errorCallback) errorCallback(res.data||\"Error\"); } }).catch(function(e){ if(errorCallback) errorCallback(\"Request failed: \"+e); });\n            }\n        },\n        showLoading: function (c) { var $ = window.jQuery || window.$; if($){ $(c).find(\".seo-tool-loading\").addClass(\"active\"); $(c).find(\".seo-tool-results\").removeClass(\"active\"); $(c).find(\".seo-tool-btn\").prop(\"disabled\", true); } },\n        hideLoading: function (c) { var $ = window.jQuery || window.$; if($){ $(c).find(\".seo-tool-loading\").removeClass(\"active\"); $(c).find(\".seo-tool-btn\").prop(\"disabled\", false); } },\n        showResults: function (c) { var $ = window.jQuery || window.$; if($){ $(c).find(\".seo-tool-results\").addClass(\"active\"); } },\n        showError: function (c, msg) { var $ = window.jQuery || window.$; if($){ var $r = $(c).find(\".seo-tool-results\"); $r.html('<div class=\"seo-tool-alert seo-tool-alert-danger\">' + this.escapeHtml(msg) + '<\/div>'); $r.addClass(\"active\"); } },\n        isValidUrl: function (s) { try { var u = new URL(s); return u.protocol === \"http:\" || u.protocol === \"https:\"; } catch (_) { return false; } },\n        isValidDomain: function (d) { return \/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$\/.test(d); },\n        escapeHtml: function (t) { if (typeof t !== \"string\") return t; var m = { \"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\", \"'\": \"&#039;\" }; return t.replace(\/[&<>\"']\/g, function (k) { return m[k]; }); },\n        formatBytes: function (b, d) { if (b === 0) return \"0 Bytes\"; var k = 1024, dm = d || 2, sz = [\"Bytes\", \"KB\", \"MB\", \"GB\"], i = Math.floor(Math.log(b) \/ Math.log(k)); return parseFloat((b \/ Math.pow(k, i)).toFixed(dm)) + \" \" + sz[i]; },\n        formatNumber: function (n) { return n.toString().replace(\/\\B(?=(\\d{3})+(?!\\d))\/g, \",\"); },\n        copyToClipboard: function (t, btn) { var $ = window.jQuery || window.$; if (navigator.clipboard) { navigator.clipboard.writeText(t).then(function () { var orig = $ ? $(btn).text() : btn.textContent; if ($) $(btn).text(\"Copied!\"); else btn.textContent = \"Copied!\"; setTimeout(function () { if ($) $(btn).text(orig); else btn.textContent = orig; }, 2000); }); } },\n        ensureProtocol: function (u) { u = u.trim(); return \/^https?:\\\/\\\/\/i.test(u) ? u : \"https:\/\/\" + u; },\n        extractDomain: function (u) { try { return new URL(this.ensureProtocol(u)).hostname; } catch (e) { return u.replace(\/^(https?:\\\/\\\/)?(www\\.)?\/, \"\").split(\"\/\")[0]; } }\n    };\n}\n<\/script>\n<div class=\"seo-tool-container\" id=\"seo-tool-sourcecode\">\n    <div class=\"seo-tool-header\">\n        <h2>Source Code Viewer<\/h2>\n        <p>View the HTML source code of any webpage with element statistics<\/p>\n    <\/div>\n    \n    <div class=\"seo-layout-dashboard\">\n        <div class=\"seo-tool-form\">\n        <div class=\"seo-tool-form-row\">\n            <label for=\"sourcecode-url\">Enter URL<\/label>\n            <div class=\"seo-tool-inline-form\">\n                <input type=\"url\" id=\"sourcecode-url\" class=\"seo-tool-input\" placeholder=\"https:\/\/example.com\" \/>\n                <button class=\"seo-tool-btn\" id=\"sourcecode-submit\">View Source<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n        <div class=\"seo-dashboard-details\">\n            <div class=\"seo-tool-loading\"><div class=\"seo-tool-spinner\"><\/div><p>Fetching source code...<\/p><\/div>\n    <div class=\"seo-tool-results\" id=\"sourcecode-results\"><\/div>\n        <\/div>\n    <\/div>\n\n\n    <!-- Enhanced Educational Landing Page Content -->\n    <div class=\"seo-landing-content\">\n        <div class=\"seo-info-grid\">\n            <div class=\"seo-info-card\">\n                <h3>What is the Source Code Viewer?<\/h3>\n                <p>This developer utility fetches and formats the raw HTML source code of a public webpage, listing scripts, header tags, and page weight statistics.<\/p>\n            <\/div>\n            <div class=\"seo-info-card\">\n                <h3>Why does it matter for SEO?<\/h3>\n                <p>Inspecting the source code lets you troubleshoot hidden scripts, identify broken tag pairings, and analyze structural SEO markup.<\/p>\n            <\/div>\n        <\/div>\n\n        <div class=\"seo-guide-section\">\n            <h3>How to Use the Source Code Viewer<\/h3>\n            <ol>\n                <li>Input the URL of the page you want to view.<\/li>\n                <li>Click **View Source Code**.<\/li>\n                <li>Examine the highlighted HTML code blocks and search headers.<\/li>\n            <\/ol>\n        <\/div>\n\n        <div class=\"seo-faq-section\">\n            <h3>Frequently Asked Questions<\/h3>\n            <div class=\"seo-faq-item\">\n                <div class=\"seo-faq-question\">Why should I view a page's source code instead of using inspector tools?<\/div>\n                <div class=\"seo-faq-answer\">Viewing the raw source code shows the exact markup served by the web server before browser JavaScript modifies it, which is how search bots view your site.<\/div>\n            <\/div>\n            <div class=\"seo-faq-item\">\n                <div class=\"seo-faq-question\">Can this tool display client-rendered JavaScript code?<\/div>\n                <div class=\"seo-faq-answer\">It fetches the initial server-side HTML. For client-rendered framework pages, use browser inspector tools.<\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n<script data-no-optimize=\"1\" data-cfasync=\"false\">\njQuery(document).ready(function($) {\n    $('#sourcecode-submit').on('click', function() {\n        var url = $('#sourcecode-url').val().trim();\n        var container = '#seo-tool-sourcecode';\n        if (!url) { alert('Please enter a URL.'); return; }\n        url = SEOTools.ensureProtocol(url);\n        SEOTools.showLoading(container);\n        SEOTools.ajaxRequest('source-code-viewer', { url: url }, function(data) {\n            SEOTools.hideLoading(container);\n            var html = '<div class=\"seo-tool-result-card\"><h3>Source Code for ' + SEOTools.escapeHtml(data.url) + '<\/h3>';\n            html += '<div class=\"seo-tool-stats\">';\n            html += '<div class=\"seo-tool-stat\"><div class=\"seo-tool-stat-value\">' + SEOTools.formatBytes(data.total_size) + '<\/div><div class=\"seo-tool-stat-label\">Total Size<\/div><\/div>';\n            html += '<div class=\"seo-tool-stat\"><div class=\"seo-tool-stat-value\">' + SEOTools.formatNumber(data.line_count) + '<\/div><div class=\"seo-tool-stat-label\">Lines<\/div><\/div>';\n            html += '<div class=\"seo-tool-stat\"><div class=\"seo-tool-stat-value\">' + data.status_code + '<\/div><div class=\"seo-tool-stat-label\">Status Code<\/div><\/div>';\n            html += '<\/div>';\n            html += '<h4>Page Title: ' + SEOTools.escapeHtml(data.title) + '<\/h4>';\n            html += '<h4>Element Statistics<\/h4>';\n            html += '<table class=\"seo-tool-table\"><tbody>';\n            html += '<tr><td><strong>Meta Tags<\/strong><\/td><td>' + data.stats.meta_tags + '<\/td><\/tr>';\n            html += '<tr><td><strong>Link Tags<\/strong><\/td><td>' + data.stats.link_tags + '<\/td><\/tr>';\n            html += '<tr><td><strong>Script Tags<\/strong><\/td><td>' + data.stats.script_tags + '<\/td><\/tr>';\n            html += '<tr><td><strong>Image Tags<\/strong><\/td><td>' + data.stats.img_tags + '<\/td><\/tr>';\n            html += '<tr><td><strong>Anchor Tags<\/strong><\/td><td>' + data.stats.a_tags + '<\/td><\/tr>';\n            html += '<\/tbody><\/table>';\n\n            \/\/ Response Headers\n            html += '<h4>Response Headers<\/h4>';\n            html += '<table class=\"seo-tool-table\"><thead><tr><th>Header<\/th><th>Value<\/th><\/tr><\/thead><tbody>';\n            data.headers.forEach(function(h) {\n                html += '<tr><td><strong>' + SEOTools.escapeHtml(h.name) + '<\/strong><\/td><td style=\"word-break:break-all;\">' + SEOTools.escapeHtml(h.value) + '<\/td><\/tr>';\n            });\n            html += '<\/tbody><\/table>';\n\n            \/\/ Source code (truncated for display)\n            var displayCode = data.source_code.length > 50000 ? data.source_code.substring(0, 50000) + '\\n\\n... (truncated)' : data.source_code;\n            html += '<h4>Source Code<\/h4>';\n            html += '<div class=\"seo-tool-code\" style=\"max-height:500px;overflow-y:auto;\"><button class=\"seo-tool-code-copy\">Copy<\/button><pre>' + SEOTools.escapeHtml(displayCode) + '<\/pre><\/div>';\n            html += '<\/div>';\n\n            window._sourceCode = data.source_code;\n            $('#sourcecode-results').html(html);\n            \/\/ Override copy to copy full source\n            $('#sourcecode-results .seo-tool-code-copy').off('click').on('click', function() {\n                SEOTools.copyToClipboard(window._sourceCode, this);\n            });\n            SEOTools.showResults(container);\n        }, function(error) {\n            SEOTools.hideLoading(container);\n            SEOTools.showError(container, error);\n        });\n    });\n});\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":3221,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"coauthors":[118],"class_list":["post-4245","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Online Source Code Viewer | Webpage &amp; HTML Code Display | Adlift<\/title>\n<meta name=\"description\" content=\"Adlift&#039;s online source code viewer makes webpage inspection a breeze. Dive into HTML structures, analyze website code, and explore pages with unmatched clarity and ease.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Online Source Code Viewer | Webpage &amp; HTML Code Display | Adlift\" \/>\n<meta property=\"og:description\" content=\"Adlift&#039;s online source code viewer makes webpage inspection a breeze. Dive into HTML structures, analyze website code, and explore pages with unmatched clarity and ease.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/\" \/>\n<meta property=\"og:site_name\" content=\"AdLift India\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AdLiftMarketingPrivateLimited\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-24T08:20:09+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@adliftindia\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Online Source Code Viewer | Webpage & HTML Code Display | Adlift","description":"Adlift's online source code viewer makes webpage inspection a breeze. Dive into HTML structures, analyze website code, and explore pages with unmatched clarity and ease.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/","og_locale":"en_US","og_type":"article","og_title":"Online Source Code Viewer | Webpage & HTML Code Display | Adlift","og_description":"Adlift's online source code viewer makes webpage inspection a breeze. Dive into HTML structures, analyze website code, and explore pages with unmatched clarity and ease.","og_url":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/","og_site_name":"AdLift India","article_publisher":"https:\/\/www.facebook.com\/AdLiftMarketingPrivateLimited\/","article_modified_time":"2026-07-24T08:20:09+00:00","twitter_card":"summary_large_image","twitter_site":"@adliftindia","twitter_misc":{"Written by":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/","url":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/","name":"Online Source Code Viewer | Webpage & HTML Code Display | Adlift","isPartOf":{"@id":"https:\/\/www.adlift.com\/in\/#website"},"datePublished":"2023-09-18T06:47:46+00:00","dateModified":"2026-07-24T08:20:09+00:00","description":"Adlift's online source code viewer makes webpage inspection a breeze. Dive into HTML structures, analyze website code, and explore pages with unmatched clarity and ease.","breadcrumb":{"@id":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.adlift.com\/in\/seo-tools\/source-code-viewer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.adlift.com\/in\/"},{"@type":"ListItem","position":2,"name":"Seo Tools","item":"https:\/\/www.adlift.com\/in\/seo-tools\/"},{"@type":"ListItem","position":3,"name":"Source Code Viewer"}]},{"@type":"WebSite","@id":"https:\/\/www.adlift.com\/in\/#website","url":"https:\/\/www.adlift.com\/in\/","name":"AdLift India","description":"","publisher":{"@id":"https:\/\/www.adlift.com\/in\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.adlift.com\/in\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.adlift.com\/in\/#organization","name":"Adlift","url":"https:\/\/www.adlift.com\/in\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.adlift.com\/in\/#\/schema\/logo\/image\/","url":"https:\/\/www.adlift.com\/in\/wp-content\/uploads\/sites\/2\/2023\/02\/adlift-logo.png","contentUrl":"https:\/\/www.adlift.com\/in\/wp-content\/uploads\/sites\/2\/2023\/02\/adlift-logo.png","width":340,"height":220,"caption":"Adlift"},"image":{"@id":"https:\/\/www.adlift.com\/in\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AdLiftMarketingPrivateLimited\/","https:\/\/x.com\/adliftindia","https:\/\/www.instagram.com\/adliftindia\/","https:\/\/www.linkedin.com\/company\/adlift-marketing-pvt-ltd-\/","https:\/\/youtube.com\/channel\/UCmkSk7fwZboGVIEPH5gsxxA"]}]}},"_links":{"self":[{"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/pages\/4245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/comments?post=4245"}],"version-history":[{"count":2,"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/pages\/4245\/revisions"}],"predecessor-version":[{"id":8622,"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/pages\/4245\/revisions\/8622"}],"up":[{"embeddable":true,"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/pages\/3221"}],"wp:attachment":[{"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/media?parent=4245"}],"wp:term":[{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.adlift.com\/in\/wp-json\/wp\/v2\/coauthors?post=4245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}