1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need some quick JS help

Discussion in 'Hire a Freelancer' started by rogerke, Nov 6, 2015.

  1. rogerke

    rogerke Regular Member

    Joined:
    Oct 5, 2014
    Messages:
    264
    Likes Received:
    145
    Ok, so I got this Facebook share code, but when hitting the share button nothing happens. Ripped it from another page where it works flawlessly.

    Anyone able to fix this? A free answer in the comment section is always nice, bit I could pay $5 for this simple fix as well.

    Code:
    <div class="share-wrap">                        <h4 class="schritt-one"><a href="#">Step 1: Share This Page</a></h4>
                            <a id="postos" href="javascript:void(0)" onClick="gt=window.open
    
    
    ('https://www.facebook.com/sharer/sharer.php?u=http://www.example.com', 
    
    
    'gt','top=176,left=500,toolbar=no,location=yes,directories=no,status=no, 
    
    
    menubar=no,scrollbars=no,resizable=no,width=800,height=50'); gt.onload = function () 
    
    
    {gt.focus();}; return false;"><strong><img src="http://i.imgur.com/ib8IFaX.gif" align="top" 
    
    
    border="0"></strong></a>
                        </div>
                        <div class="like-wrap">
                         
     
  2. delite737

    delite737 Registered Member

    Joined:
    Nov 1, 2013
    Messages:
    70
    Likes Received:
    11
    I hope you made sure to empty your inbox,a lot of developers will want their chance to claim the reward money I am sure
     
    Last edited: Nov 7, 2015
  3. johnny1221

    johnny1221 Regular Member

    Joined:
    Jan 26, 2015
    Messages:
    267
    Likes Received:
    47
    try replacing the the javascript:void code with the link of your page
     
  4. hassekf

    hassekf Newbie

    Joined:
    Oct 25, 2014
    Messages:
    12
    Likes Received:
    2
    Hey mate, here is your solution:

    The problem was that javascript can't render multi lines like other languages, so just put all the JS code that is inside "onClick" in one line. It will work.
    I can't post here because i cant post links. But do as i say, remove all spaces on your code and put all in one line, it will work, i've tested here.


    Will send my paypal email through PM.

    Enjoy.
     
  5. 0m1kr0n

    0m1kr0n Newbie

    Joined:
    Jan 31, 2012
    Messages:
    44
    Likes Received:
    4
    Code:
    <a id="postos" href="#" onClick="gt=window.open('https://www.facebook.com/sharer/sharer.php?u=http://www.example.com','gt','top=176,left=500,toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=50'); gt.onload = function (){gt.focus();}; return false;"><strong><img src="http://i.imgur.com/ib8IFaX.gif" align="top" border="0"></strong></a>
    Fixed&Tested

    Everyone send me millions of bitcoins!!!! 1JGh27VymKNLKJ2d7txL8Qz9As2zCjWnDB
     
    Last edited: Nov 7, 2015