Home Ask Login Register

Developers Planet

Your answer is one click away!

Frank February 2016

Why am I getting the html tags from jQuery and HttpHandler?

I have the following code :


The html looks like this :

<div id=Page_div>
      <Table Border=1>
          <Td><button id=Current_1 type=button></button></Td>
          <Td><button id=Current_2 type=button></button></Td>
          <Td><button id=Current_3 type=button></button></Td>
          <Td><button id=Current_4 type=button></button></Td>
          <Td><button id=Current_5 type=button></button></Td>
          <Td><button id=Current_6 type=button></button></Td>
          <Td><button id=Save type=button>Save</button></Td>

And the HttpHandler code looks like this :

  public void handle(HttpExchange exchange)
    OutputStream responseBody=exchange.getResponseBody();
    String requestMethod=exchange.getRequestMethod(),requestPath=exchange.getRequestURI().getPath(),title="ABC",
             New_Info,responseString="<Html>\n<Head>\n  <Title>"+title+"</Title>\n</Head>\n<Body BgColor=#FDF5E6>\n<Center>\n"+Get_jQuery()+"\n\n";
    LinkedHashMap<String,String> params=queryToMap(exchange.getRequestURI().getRawQuery());
    File file;


      if (New_Info!=null)                                                                    // After Save button is clicked, save new user info
        Headers responseHeaders=exchange.getResponseHeader        


Quentin February 2016

text() means "Treat the content as plain text".

If you want to treat it as HTML source code then use html() instead.

Post Status

Asked in February 2016
Viewed 3,170 times
Voted 9
Answered 1 times


Leave an answer

Quote of the day: live life