2013年9月2日星期一

jsp in the js code in the head does not appear


Why is this code in jsp pages inside the body can perform , but on the head can not be executed
------ Solution --------------- -----------------------------

wrapped in a layer of your method code like this:
$ (function () {
/ / middle is your code
});
------ For reference only ------------------------------- --------
on the head of the JS code will be read before the page is loaded , while on the body of the JS code will be read after the entire page has finished loading

------ For reference only ---------------------------------- -----
example, you want to call a thing , not loaded, this problem occurs . .

------ For reference only -------------------------------- -------
how to solve it , and put this code into the head , it is also able to perform ?
------ For reference only -------------------------------------- -
with $ (document). ready (function () { js call your method }
------ For reference only ---------------- -----------------------

wrapped in a layer of your method code like this:   
$ (function () {   
/ / middle is your code   
});  


positive solution

没有评论:

发表评论