Preface: The front page needs a large medium and small three fonts, these three fonts corresponding to a CSS file, and then the client with a cookie to save the CSS file name prefix. The implementation is this way, the user click Select "Big Small" three buttons, and then use the $.cookie method of jquery to the client to save "fontSize" Such a variable, the variable value corresponds to one of the CSS file name of the three font. Then compile the JSP page with the JSTL tag to take fontsize value, load the corresponding CSS file.
Js:
Jsp:
So here's the problem: I localhost:8080/project/the "big" font on my home page, but found out how localhost:8080/project/register.jsp didn't work, The value that the cookie takes out is not the same as the value of the home page, which is why?
My solution: Use Firefox to view cookies: There are two fontsize of wood!
Look at the details below, the original path is not the same,--, one is localhost:8080/project/; The other is localhost:8080/project/register.jsp.
Workaround: Add the path attribute when setting cookies with jquery.
This way, no matter on which page settings cookie,fontsize are only one, take out the nature is the only fontsize. (Today we have this problem to record it quickly)
---------------------------Split Line---------------------------
found that the current diary can not be called ' meter of the building station Diary ', because this is not the construction station encountered problems, but the work encountered problems, the amount, said so many.
December 23, 2014