How do I stop a web page from scrolling to the top when a link is clicked that triggers JavaScript?

This was a challenge to me at first but when I did some backtest and scan through my entire codes i was able to get the required result I needed when I clicked on the link, and since I have been able to deal with this problem,I wont want you to pass through the stress

How to Encode html entities in javascript

Here is a breakdown to encode html entities in javascript.This will help you understand how HTML entities can be encoded in javascript with ease which you can use as well. You can use regex to replace any character in a given unicode range with its html entity equivalent. The code would look something like this:

Where to place JavaScript in an HTML file?

As a rule of thumb, the best place to put <script> tags is the bottom of the page, just before </body> tag. Something like this: Yahoo have also released a really cool guide that lists best practices to speed up a website. Definitely worth reading: HTML: CSS: