facebook

HTML quote shortcode returns 2 quotes in MobiOne: CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #347033 Reply

    rick.gommers
    Member

    Hi all,

    I have the following code in my app:

    "<td><img src="images/potlood-wijzig.png" /></td>"+

    I use the " ascii code to prevent breaking the html parser in javascript. This is according to the guidelines on this site: http://www.ascii.cl/htmlcodes.htm

    MobiOne however, descides to enter 2 “” when using this ascii code. See the source of my app (image taken from simulator source):

    Could you change this for me so MobiOne works according to the ascii guidelines and enters only one ” ?

    Thx in advance!

    #347036 Reply

    Hi marcoevich,

    I have opened an enhancement bug for this, in the meantime the workaround is not to use the ascii code for the quotes.

    #347038 Reply

    rick.gommers
    Member

    Hi Ocatvio,

    Thx for the update.

    Do you have an idea when such enhancement could be in place?

    #347307 Reply

    Hi marcoevich,

    Could you please share a sample project that demonstrate the issue so we can investigate it quickly?

    #347343 Reply

    rick.gommers
    Member

    Hi octavio,

    Well, let me start by noting that I’ve solved my initial problem.

    When this problem occurred I didn’t think of the possibility to use single quotes.

    This problem..

    "<td><img src="images/potlood-wijzig.png" /></td>"+

    ..can be fixed by using single quotes inside the double quotes, like so:

    "<td><img src='images/potlood-wijzig.png' /></td>"+

    However I still think that you should follow the ascii table rule of parsing only a single ” or ‘ when using " and ' notation. That will provide us with another method of adding classes and variables etc using javascript, in case single quotes won;t work. So good to see you’re working on it 🙂

    I’ve created an example for you that you can download here: https://dl.dropboxusercontent.com/u/15584788/QuotestTest.zip

    Click the generate table button. You should see a table being generated with 2 fields with a value and a placeholder in it. These value and placeholder contain double ” if you look at the source code. This result in the quotes being visible in the fields.

    Also, look at the id of the <tr>. It’s impossible to retrieve an id that looks like this:

    <tr id="'item01'"

    If you see what I see, then you notice that the html ascii code for single quotes ( ' ) also parses a double quote…

    Thank you for looking into this 😉

    #347355 Reply

    Hi marcoevich,

    I have recieved feedback from the dev team: HTML codes are NOT valid inside JS strings, so, f.e.

    ("#aa").append(
      "<tr id='item0"+3+"'>"+
    "<td><img src="images/potlood-wijzig.png" /></td>" +
            "</tr>");
    

    Here " is parsed as a part of src attribute value, this is a behaviour that is not related neither to Mobione nor to even jQuery, the same could be reproduced with pure JS and DOM. An alternative is that JS allows to have quotes inside quoted strings through prefixing them by \

    Example:

    ("#aa").append(
      "<tr id=\"item0"+3+"\">"+
    "<td><img src=\"images/potlood-wijzig.png\" /></td>" +
            "</tr>");
    
    #347432 Reply

    rick.gommers
    Member

    Hi Octavio,

    Thx a lot for the clarification! I didn’t know that ascii codes where not accepted in js strings.

    I’ll learn something more every day 🙂

    Thx again!

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: HTML quote shortcode returns 2 quotes in MobiOne: CLOSED

You must be logged in to post in the forum log in