相关疑难解决方法(0)

在JavaScript变量中存储HTML或XML代码

我想在javascript变量中存储一些HTML/XML标记.问题是文本比较大.例如,如何将以下XML片段存储在javascript变量中?

    <QuestionForm xmlns="[the QuestionForm schema URL]">
  <Overview>
    <Title>Game 01523, "X" to play</Title>
    <Text>
      You are helping to decide the next move in a game of Tic-Tac-Toe.  The board looks like this:
    </Text>
    <Binary>
      <MimeType>
        <Type>image</Type>
        <SubType>gif</SubType>
      </MimeType>
      <DataURL>http://tictactoe.amazon.com/game/01523/board.gif</DataURL>
      <AltText>The game board, with "X" to move.</AltText>
    </Binary>
    <Text>
      Player "X" has the next move.
    </Text>
  </Overview>
  <Question>
    <QuestionIdentifier>nextmove</QuestionIdentifier>
    <DisplayName>The Next Move</DisplayName>
    <IsRequired>true</IsRequired>
    <QuestionContent>
      <Text>
        What are the coordinates of the best move for player "X" in this game?
      </Text>
    </QuestionContent>
    <AnswerSpecification> …
Run Code Online (Sandbox Code Playgroud)

javascript xml jquery cdata mechanicalturk

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

cdata ×1

javascript ×1

jquery ×1

mechanicalturk ×1

xml ×1