facebook

HTML Widget to Text

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

    colinvloef
    Member

    Hey,

    I’m used to PHP and C++, I’m a real novice to Javascript.
    I can’t find a way to get the text from my html.

    The HTML widget links to a site where only text is displayed and I want to get it in a variable so I can process it later.

    I’ve tried

    var fromHtml = $('[id$=html2').html;

    and

    var fromHtml = $('[id$=html2').val;

    I don’t get the text

    This is the url I want to get:
    http://colin.000a.biz/tableStr.htm

    #344286 Reply

    MrBean
    Member

    @colinvloef wrote:

    Hey,

    I’m used to PHP and C++, I’m a real novice to Javascript.
    I can’t find a way to get the text from my html.

    The HTML widget links to a site where only text is displayed and I want to get it in a variable so I can process it later.

    I’ve tried

    var fromHtml = $('[id$=html2').html;

    and

    var fromHtml = $('[id$=html2').val;

    I don’t get the text

    This is the url I want to get:
    http://colin.000a.biz/tableStr.htm

    Try
    URls shall be replaced with the name of the mobione project containing the widget.

    var fromHtml = $(‘[#m1-URLs-html2’).text();

    or

    var fromHtml = $(‘[#m1-URLs-html2’).val();

    See documentation,
    http://www.genuitec.com/mobile/docs/widgetReference/widgetReference.html#text_properties

    #344288 Reply

    colinvloef
    Member

    Thanks! It works 🙂

    (Except for the “.val();” but no problem, I’ll just use “.text();”

    #353025 Reply

    calosteward
    Member

    Hi. colinvloef
    Thank you, my project also works correctly.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: HTML Widget to Text

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