What changes should be made to the image scirpt to share content on Social media

Sam Mak <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <CAODh+R8JcLmzgc4YfKbaXfP9awKQSCOBmiFfREn5P8yKzO=8vA@mail.gmail.com>
I am using a script on my blogger blog which uses externally source images
with previous and next button.

The script include currentUrl function to create a page impression whenever
next or previous button is clicked.
I want to add facebook share button, which enables a user to share the
picture they are viewing, but i believe it cant be done,because i tried to
copy paste the link on the address bar (which changes with picture due to
currentUrl function) on facebook but it couldn't retrieve the image
associated with url, is it possible to make any changes to the script so
that images can be shared on facebook and other social media? Please Help.

Regards

Sam

HTML Code:


    <body onload="showPicNo(a)">

        <div id="picture"><img name="picturegallery"></div>

        <div id="navigation">

           <a href="javascript:bw()">previous</a> | <a
href="javascript:fw()">next</a>

        </div>

      <body>



javascript code:



    var pics=new Array ("
http://4.bp.blogspot.com/_UdzqQpb36Jo/R9kVS0h1BFI/AAAAAAAAD_o/SRGugAQSF0A/s1600/timming_pictures_37.jpg
","
https://lh3.googleusercontent.com/-et1BbdI-Dqk/UbM0JNa5VSI/AAAAAAAAAdw/cd6yN5HWvmc/s480-no/Funny+Lady+French+Kiss+With+Lion.jpg
","
https://lh3.googleusercontent.com/-pSwjTBzFDM0/UbMukN2vTbI/AAAAAAAAAbc/ZMLSTtO-JUk/w460-h511-no/funny-pictures-auto-woman-boobs-477558.jpeg
")

    var a=0;

    var b = pics.length;

    var currentUrl = document.URL;

    var existsPicParameter = currentUrl.match(/picnoparam\S*/i);



    var tmpPicParameter, tmpPicParameterOld;



    if (existsPicParameter != null)

    {

      tmpPicParameter = existsPicParameter[0].match(/picnoparam=\d+/i);

      if (tmpPicParameter != null)

      {

        a = parseInt(tmpPicParameter[0].match(/\d+/i));

        tmpPicParameterOld = tmpPicParameter[0];

      }

    } else {

      a = Math.floor(Math.random() * (b - a)) + a;

    }



    function fw()

    {

     if (a == (b - 1))

     {

      a = 0;

     } else {

      a++;

     }

     navigate(a);

    }



    function bw()

    {

     if (a == 0)

     {

      a = b - 1;

     } else {

      a--

     }

     navigate(a);

    }



    function navigate(a)

    {

     if (existsPicParameter == null)

     {

      if (currentUrl.indexOf("?") == -1)

      {

        currentUrl += "?";

      } else {

      currentUrl += "&";

      }

      currentUrl += "picnoparam="+a;

     } else {

      tmpPicParameter[0] = tmpPicParameter[0].replace(/\d+/i,a);

      currentUrl = currentUrl.replace(tmpPicParameterOld,
tmpPicParameter[0]);

     }

      window.location.replace(currentUrl);

    }



    function showPicNo(picNumber)

    {

      window.document.images["picturegallery"].src=pics[picNumber];

    }



    function randomPicture()

    {

      erg = Math.floor(Math.random() * (b - a)) + a;

      showPicNo(erg);

    }

-- 
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/groups/opt_out.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.