Joke Collection Website - Mood Talk - How to get the value of java variables in js, friends help me talk about it.
How to get the value of java variables in js, friends help me talk about it.
Theoretically, the variable values of Java cannot be obtained in js, but they can be obtained indirectly. Two ideas are provided for reference: 1, the value of java variables is stored in cookies, and js takes the value through cookies; & ltpre t="code" l="js "> function getCookie (name)
{
Var arr, reg = new regexp ("(|)"+name+"= ([; ]*)(; |$)");
if(arr = document . cookie . match(reg))
Return UNESCAPE (arr [2]);
other
Returns null
}
var value = get cookie(" cookie name "); 2. Assign the value of java variable to the page.
- Related articles
- I dreamed that the necklace was broken and the beads were scattered all over the floor.
- What does stock subscription mean?
- Tell me about the Battle of Stalingrad.
- If love has a beautiful sentence of providence.
- You are the only one in my life.
- Write an imaginary composition according to the cartoon "My Son's Gift". How to write? The key is what role do I play in the easier writing? It is best not to write an argumentative essay, but to
- What is an opening poem?
- What are some beautiful sentences describing the Qinghai-Tibet Plateau?
- Which players in the NBA have passed by the "Death"?
- Excuse me, are Seuss and Kiop family?