People need to put this JS that would be a floating Whatsapp on a PHP page!

Asked

Viewed 50 times

-2

People I’m trying to put this JS on my site that is in PHP but I tried the ways I know but nothing worked I would like the help of you I believe that just put in a page I can already put in all a Help Please! follows the JS Obs:. It gets floating ok?

<==script type="text/javascript">
    (function () {
        var options = {

            whatsapp: "+5583996588383", // Line QR code URL
            email: "[email protected]", // Email
            call: "083996588383", // Call phone number
            company_logo_url: "", // URL of company logo (png, jpg, gif)
            greeting_message: "Tudo bem!", // Text of greeting message
            call_to_action: "Estou Aqui!", // Call to action
            button_color: "#34af23", // Color of button
            position: "left", // Position may be 'right' or 'left'
            order: "whatsapp,call,email" // Order of buttons
        };
        var proto = document.location.protocol, host = "whatshelp.io", url = proto + "//static." + host;
        var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
        s.onload = function () { WhWidgetSendButton.init(host, proto, options); };
        var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
    })();
<==/script==>  (coloquei == proposital)

1 answer

0

There are 2 ways to do this , the 1st:

  • Add the code block at the end of each PHP page where you would like to view the script.
  • Or add this code to a separate file is to use the tag: <==script type="text/javascript" src="file.js"==><==/script==> to relate your file to the php page you want it to be viewed on.

A good way to test the implementation, would be using the https://codepen.io/pen.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.