Change HTML HEAD in diferents pages

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 年 前
I want to enter a code on a specific page. This is because the facebook pixel plugin does not work at check out. How can I enter the following code:
</script><script src="https://connect.facebook.net/signals/config/680114432155937?v=2.9.22&amp;r=stable" async=""></script><script async="" src="https://connect.facebook.net/en_US/fbevents.js"></script>

THERE in this head!
<html lang="es" class="html-checkout-page html-billing-address-page k-webkit k-webkit83">
<head>......</head>
I TAKE THIS CODE WITH GOOGLE DEV TOOLS.
THANKS IF SOMEBODY CAN HELP ME!
3 年 前
Using JavaScript and jQuery is a very easy way to accomplish this. First, just build a sample JavaScript file. Inside, make functions that are run on page load. For example,

function buildPage() {
    var html = ' ';
    //Build the html through the function
    //In the end...
    $('html-id').empty().append(html);
}
This way each time the html is built you can just empty(clear whatever is in the id 'html-id') and then add your specific html. For example,

<html>
    <head>Put header here!</head>
    <body>
        <div>Put tabs with onclick events here</div>
        <div id="html-id"></div>
    </body>
</html>
Each time a different tab is clicked, the buildPage() function should be called in order to build the page accordingly. No multiple html headers needed!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.