javascript - 2 different js file in same html -
what want achieve call external .js file .aspx, first thing generate tooltip function in master page, go .aspx call external .js file, doesnt work. in .aspx, cant alert homepage.js, 1 can tell me mistake?
master page
<script type="text/javascript" > function showtooltip() { //do based on data passing in
}
homepage.aspx
<script type="text/javascript" src="http://[servername]/scripts/homepage.js"></script>
homepage.js
<script type="text/javascript" > alert("homepage.js"); var datamenu = { lbl1: "fruit", lbl2: "auto mobile" } </script>
make sure document ready before script called.
$(function(){ alert("homepage.js"); }); var datamenu = { lbl1: "fruit", lbl2: "auto mobile" }
make sure path file correct , looks have os path in src..give relative path
Comments
Post a Comment