Home > front end >  How to control the ArrayList in js subscript?
How to control the ArrayList in js subscript?

Time:09-21

The front-end js code:
for(var i=0; I<'& lt; S: property value="https://bbs.csdn.net/topics/#session.news.size ()"/& gt; '; I++)
{
Newdiv='& lt; Div & gt; + '
'& lt; B & gt; + '
'& lt; S: property value="HTTP://https://bbs.csdn.net/topics/#session.news.get. (3) getNewstitle ()"/& gt; + '
'& lt; Br> '& lt; S: property value="HTTP://https://bbs.csdn.net/topics/#session.news.get. (3) getNewsauthor ()"/& gt; & nbsp; & nbsp; + '
'& lt; B & gt; + '
'& lt; S: property value="HTTP://https://bbs.csdn.net/topics/#session.news.get. (3) getNewsdate ()"/& gt; & nbsp; & nbsp; + '
'& lt; S: property value="HTTP://https://bbs.csdn.net/topics/#session.news.get. (3) getNewstime ()"/& gt; + '
'& lt; The pre readonly="readonly" onclick="divUPUP (this);"> + '
'& lt; S: property value="HTTP://https://bbs.csdn.net/topics/#session.news.get. (3) getNewscontent (), toString ();"/& gt; + '
'& lt;/pre>
';
Maindiv. InnerHTML +=newdiv;
}
Want to cycle through dynamic control in the code ArrayList subscript
Get the inside of the 3 should change to what can be achieved?

CodePudding user response:

The variable I in three substitute a for loop

CodePudding user response:

There should be a "item # in the session. News. The size ()" syntax, generally do not write for the HTML block

CodePudding user response:

1/f, reference code for the family's reply:
3 replacement into a for loop in the variable I

Tried not I variables in js, and session in single quotes', I will not change in the

CodePudding user response:

Replace with the I changed the following characters you
'& lt; S: property value="HTTP://https://bbs.csdn.net/topics/#session.news.get. (3) getNewstitle ()"/& gt; + '
To '& lt; S: property value="' + # session. News. Get (I). GetNewstitle () + '"/& gt; '+

CodePudding user response:

reference colorful の bird, 3/f - response:
Quote: 1/f, reference code for the family's reply:

Of the three substitute a for loop variable I

Tried not I variables in js, and session in single quotes', I will not change in the

The 3 replace "+ I +"
  • Related