0

My need is as following:

  • I have an iOS mobile phone with a webview component.
  • I use the webview to show my facebook page feeds on the app with Likebox
  • All works fine but when a user clicks on the links from the likebox it leaves the webpage and get redirected to facebook which is normal BUT I WOULD LIKE TO DISABLE THAT FEATURE

Can any body help ?

I can do any work arround using: PHP, jQuery

ideally I would like to keep like button working

1 Answer 1

1

You could use jquery to intercept the clicks on any link in that div and then have them return false, right?

$('#likebox a').click(function() { return false; });

Maybe?

8
  • 1
    Better would be to use $('#likebox a').on('click', function(event){event.preventDefault();}); Mar 25, 2013 at 16:45
  • Per dox, that would appear to be a better option (api.jquery.com/event.preventDefault)
    – sent1nel
    Mar 25, 2013 at 16:47
  • hum... I would give it a try, but how about the like button ? I would like to keep it, but the webview doesn't go back to my page after authenticating Mar 25, 2013 at 17:08
  • Did you check the like-box dox? (developers.facebook.com/docs/reference/plugins/like-box). It would seem the 'like' button is a <button> and not an <a>, so that code shouldn't affect the like button provided you're just selecting a elements :)
    – sent1nel
    Mar 25, 2013 at 17:10
  • Yes, still the problem of beeng redirected back after authentication in Facebook Mar 25, 2013 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.