Home > front end >  Js joining together HTML cannot execute onclick
Js joining together HTML cannot execute onclick

Time:05-20

The JSP code:



Start time & lt;/td>

<"P" onclick="prevMonth ()" & gt; <





Js source code is stored in the calendar. Js
The function main (source) {
GetCurrentDate ();
Var strFrame='& lt; The table class=mt id=mt> ';
StrFrame +='& lt; tr> ';

StrFrame +='& lt; td> ';
StrFrame +="& lt; P onclick=\ "prevMonth () " & gt; ";
StrFrame +='& lt; <';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; Td colspan=5 & gt; ';
StrFrame +='& lt; P> ';
StrFrame +=now. GetFullYear () + 'years' + (now, getMonth () + 1) +' month ';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +="& lt; P onclick=\ "nextMonth () " & gt; ";
StrFrame +='& gt;> ';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';
StrFrame +='& lt;/tr> ';

StrFrame +='& lt; tr> ';
StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +=', ';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='a';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='2';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='three';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='4';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='five';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='6'.
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';
StrFrame +='& lt;/tr> ';
StrFrame +='& lt;/table> ';
//var div1=document. GetElementById (" div1 ");
Var div2=document. GetElementById (" div2 ");
If (source=='start') {
Div1. InnerHTML=strFrame;
Div2. InnerHTML="";
} else {
Div2. InnerHTML=strFrame;
Div1. InnerHTML="";
}
}
The function prevMonth () {
Alert (" a ");
}

CodePudding user response:

Somehow can perform again, what the hell is this

CodePudding user response:

refer to the original poster morning when daddy response:
JSP code:



Start time & lt;/td>

<"P" onclick="prevMonth ()" & gt; <





Js source code is stored in the calendar. Js
The function main (source) {
GetCurrentDate ();
Var strFrame='& lt; The table class=mt id=mt> ';
StrFrame +='& lt; tr> ';

StrFrame +='& lt; td> ';
StrFrame +="& lt; P onclick=\ "prevMonth () " & gt; ";
StrFrame +='& lt; <';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; Td colspan=5 & gt; ';
StrFrame +='& lt; P> ';
StrFrame +=now. GetFullYear () + 'years' + (now, getMonth () + 1) +' month ';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +="& lt; P onclick=\ "nextMonth () " & gt; ";
StrFrame +='& gt;> ';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';
StrFrame +='& lt;/tr> ';

StrFrame +='& lt; tr> ';
StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +=', ';
StrFrame +='& lt;/p> ';
StrFrame +='& lt;/td> ';

StrFrame +='& lt; td> ';
StrFrame +='& lt; P> ';
StrFrame +='a';
StrFrame +='& lt;/p> '; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related