-2

enter image description here

$(this).attr('href')

I know that this code brings me to the link as a whole But I want to just get on https://www.facebook.com

isherwood
  • 58,414
  • 16
  • 114
  • 157

1 Answers1

0

try with this:

$(this).attr('href').split("/")[2]
Sasa
  • 1,172
  • 1
  • 15
  • 24
  • Did not work with me Can you give me an example of a way to get a link http://jsfiddle.net – Abdallha dagga Sep 26 '14 at 16:36
  • Maybe, @Abdallha, if *you* show some representative ([MCVE](http://stackoverflow.com/help/mcve/)) code to show what exactly you're doing, or trying to do, we can offer better answers. As it is your question is far too vague to be properly answered. – David Thomas Sep 26 '14 at 16:39
  • I want to get a link to the page as in the picture Link without the original's – Abdallha dagga Sep 26 '14 at 16:46
  • @Abdallhadagga I'm not following you... If you need a domain of your current position you can try with this: alert(document.domain); – Sasa Sep 26 '14 at 16:51
  • I did not mean to offend, but do not speak English – Abdallha dagga Sep 26 '14 at 16:56
  • 1
    @Abdallhadagga it's ok... Try to explain your problem as best as you can, give us part of your code, your thoughts, your final goal... – Sasa Sep 26 '14 at 16:59
  • please you cann add me on facebook fb.com/abdallhadagga – Abdallha dagga Sep 26 '14 at 17:15