I am trying to create a link that people can put on their own websites that links back to their profile on my site.
I have created the ‘widget’ using javascript so have a .js file that simplified does this…
document.write("Visit my profile at...");
document.write(" <a href=\"myprofilelink.html\">Click To View</a>");
I want to be able to create a call to it that automatically includes the profile link in the javascript so for example, something like….
<script src="widget.js" id="myprofilelink.html></script>
Can someone point me in the right direction?
You could create a variable before including your widget script.
Then you can just use the variable in your widget.js file:
If you want to learn about how to work with more advanced JavaScript widgets I’d recommend reading Developing An Embeddable Javascript Widget.