admin管理员组文章数量:1336193
I copied the code from this link by giving pany name and clicking the Get Code button. It generated the code given below
<script src="//platform.linkedin/in.js" type="text/javascript"></script>
<script type="IN/FollowCompany" data-id="361557" data-counter="right"></script>
I pasted this code in tag of a html file and then run the html file in Chrome, Firefox and IE, but all browser gave a blank page as output.
Then I paste those script n the tag but the output remains same.
How should I create the html file, so that it could generate the inFollow button.
Please help me.
I copied the code from this link by giving pany name and clicking the Get Code button. It generated the code given below
<script src="//platform.linkedin./in.js" type="text/javascript"></script>
<script type="IN/FollowCompany" data-id="361557" data-counter="right"></script>
I pasted this code in tag of a html file and then run the html file in Chrome, Firefox and IE, but all browser gave a blank page as output.
Then I paste those script n the tag but the output remains same.
How should I create the html file, so that it could generate the inFollow button.
Please help me.
Share edited Jul 3, 2012 at 17:04 Charles 51.4k13 gold badges106 silver badges144 bronze badges asked Jul 3, 2012 at 13:59 Chandra SekharChandra Sekhar 19.5k18 gold badges87 silver badges131 bronze badges 5- can you view the source of in.js file in your html – defau1t Commented Jul 3, 2012 at 14:13
- @refhat in.js is not my script file. Its the linkedin file. you can see the source code by selecting the plete url associated with it and paste it in address bar of any browser. Just use the url platform.linkedin./in.js – Chandra Sekhar Commented Jul 3, 2012 at 14:16
- I think problem is on Linkedin side. I had this script for almost one year, and it worked. Few days ago I saw that button is oppening about:blank page. – Andrei L Commented Dec 4, 2017 at 13:49
- Problem can be reproduced even on generator page. – Andrei L Commented Dec 4, 2017 at 14:01
- @AndrewLuca Just so you know, you only need to type your message once... Not on every post on the page. – BritishWerewolf Commented Apr 30, 2018 at 14:57
2 Answers
Reset to default 3Well it appears that you are just invoking the JavaScript. You must place the JavaScript into an HTML Document and then have an element that corresponds with that script.
Remember you also have to have a full structured HTML Document before you can just place Script tags into it, you need html, body, head, tags, etc.
Try creating an HTML Document and placing this within the .html file.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script src="//platform.linkedin./in.js" type="text/javascript"></script>
<script type="IN/FollowCompany" data-id="361557" data-counter="right"></script>
</body>
</html>
Tips to remember:
- A lot of scripts require an element to correspond with.
- You may either place the script within the script tags in the body tags or the head tags, depending on if you may or may not be selecting an element on the page.
- Each HTML document requires the correct mark-up before a browser can render it.
Hope this helps!
EDIT: Just upload it to a server, once you do that, it will work. I cannot explain why though.
It is not working locally because it is using protocol relative URL. If you change src="//platform.linkedin./in.js"
to src="https://platform.linkedin./in.js"
it will work.
本文标签: javascriptLinkedIn follow company button showing blank pageStack Overflow
版权声明:本文标题:javascript - LinkedIn follow company button showing blank page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742402221a2468113.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论