Function adding and how to make it work?

Currently trying to work with functions in a html code, i have a function giving the website a number from a 3rd party site, that is continually changing, that functions works, the issue i am having is i want to add an extra number to that so it adds up to a final number that would show on the website.

First function from 3rd party site + Number i would like to add = Outcome (which is to be live on the site)

This is my attempt of the html with with working function below that.

//HTML (note had to remove < so it would show the html on here)
script>
var z, x, y;
x = 30;
z = (“PlayerOnAir”)
y = x + z
/script>
//FUNCTION
}
function LoadRadioData(){

                 getPageContents(function(Date){
                     var obj = JSON.parse(Date);

                     $("#PlayerOnAir").text(obj.listeners);
                     if(obj.artists === null) {
                         $("#PlayerArtist").text("Unknown");
                         $("#PlayerSong").text("Unknown");
                     }else{
                         $("#PlayerArtist").text(obj.artists);
                         $("#PlayerSong").text(obj.title);
                         LoadGoogleSongImage(obj.artists + " - " + obj.title);
                     }
                 },"RadioInfo.php");
             }

Please post a link to your code or just add your code into the post.

1 Like