How to solve multiple jQuery and j.s conflicts on an HTML page

Some customized j.s effects arent only a path on an HTML page, you may need a raw script after the  footer area, so when you try to add more functions on the same page, those codes can be conflicted from time to time, here is a solution I found for this problem:

First of all, I noticed my date picker j.s will break the customized slider function, I checked the console and saw:

Uncaught Typeerror: $ Is Not a Function



To avoid this common error, I added the code below at the end of the first jquery:

 <script type="text/javascript">

if (typeof $ == 'undefined') {
var $ = jQuery;
}

</script>


So the page became normal again.
The solution works on WordPress pages too, hope it helps you out!