+ 13
@Tashi Yeah it's not "hack" and this demonstrates the requirement of SOP(Same-origin Policy) and the AJAX problem is also related with CORS and SOP. Well, @Serena â˜ș Thanks.
16th May 2017, 5:53 PM
NepZ
NepZ - avatar
+ 13
It's not a hack, just web crawling/scraping, but it's nice indeed ^^ [Edit] Btw, you can do it with Java, too, using e.g. Jsoup or Jaunt. But unfortunately this won't work at the code playground.
16th May 2017, 5:24 PM
Tashi N
Tashi N - avatar
+ 7
@Retul If you want to get the user id of someone then go to their profile and click on the share button, numbers after /Profile/ in the URL is the userId and if you want to retrieve the userId of your client running your code then window.parent.userId would work if the client viewing the code is from web browser's code section. Try this: var cid = window.parent.userId?window.parent.userId:0;
19th May 2017, 10:04 AM
NepZ
NepZ - avatar
+ 4
Nice code but how to get user ID?
19th May 2017, 10:03 AM
Retul
Retul - avatar