Steps:
1. I first created a div inside my .html file that will house the
2. I then created an anchor inside the div with only the "id" of the tag provisioned. href needs to be blank quotes and their should be no text that shows the link on the page.
By doing this, you are essentially creating a placeholder for your dynamic link on your page. If you were to post your updated .html file you will see that there is no link displayed on the page to click.
The second part of this is to use javascript to insert your desired link dynamically into the
1. The first line of code gets the id of the
2. The second line of code sets the href of the
3. The third line of code sets the target of the
When your javascript function runs, the link will dynamically show up on the web page. You can see this in action at http://people.emich.edu/jguest/IS449W/indiv2/default.html . Just click on a link on the left hand side and you will see my dynamic link to buy a book show up on the right hand side.
Hopefully this will help you in your endeavors with your dynamic websites. Although I found this trick out on my own, I did a quick google search and found sites like http://www.codelifter.com/main/tips/ that offer cool tips and code you can use to spice up your web page.
Enjoy!!
That's pretty cool. I never knew we had to have a dynamic link in our individual assignment. I will probably steal your post and apply it to my page somehow. thanks for the post.
ReplyDeleteThis is really nice. Thats an idea how to realize some ideas on my project which I thought might be difficult to realize. Thanks for the post!
ReplyDelete