Colin Brazier
asked on
What does this javascript do?
Hi experts, I copied this link from the Twitter website into my code and would like to know what it does, my Twitter link still works without it.
Col
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
Thanks,Col
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It only loads the correct code. If you didn't use the widget code somewhere else, it's useless.
You probably only wanted a link, making the widget totally unnecessary.
You probably only wanted a link, making the widget totally unnecessary.
OK thanks, but then shouldn't it make a difference if I leave the script out?If you leave it out and your page still works then you don't need it.
ASKER
Thanks.
You are welcome.
ASKER
Open in new window