Put a HTML tag into a colunm - Using SERVER-SIDE SCRIPT

Put a HTML tag into a colunm - Using SERVER-SIDE SCRIPT

diondudiondu Posts: 24Questions: 0Answers: 0
edited April 2010 in General
Helo I want my server-side script response to have a HTML tag like IMG in the last column, the problem is that the DataTable doesn't understand that the Data I want to put in the colum is and NOT "

Replies

  • jemisonjemison Posts: 21Questions: 0Answers: 0
    try something like
    $img = '';
    and in the json
    ..
    $sOutput .= '"'.$img.'",';
    ...
  • CassiannoCassianno Posts: 19Questions: 0Answers: 0
    Or just use single quotes instead of double:

    [code][/code]
  • diondudiondu Posts: 24Questions: 0Answers: 0
    Cassianno I did this in my ASP script using single quote but the browser transform it into double quote and send the answer to the javascript using double quotes.

    I am using ASP, so I can't do what jemison answered.

    Does anybody else has a sugestion?
  • pimperishpimperish Posts: 17Questions: 0Answers: 0
    Yo could try just leaving out the quotation marks. It's not proper markup, but it works in FF, Chrome, and Safari. I'm on a mac so I can't check IE.
  • diondudiondu Posts: 24Questions: 0Answers: 0
    Great idea pimperish. It worked.

    The only problem is that this is a quiet limited because without quotes I can only work with tags properties of only one word. For example: if I want to put a Title in this img, the code will be . Without quotes the browser "thinks" the title is only Edit and row is another property of the img.
  • pimperishpimperish Posts: 17Questions: 0Answers: 0
    Yeah, that was only a quick fix if that's all you needed. I feel like jemison's idea about escaping the quotes should work. But, you could always change your table structure to have a column for the url and any other attributes you want and then construct the image with a custom renderer
This discussion has been closed.