×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    5

    How to write a wml formatted text generated by a script function?

    How to write, in the page displayed by the browser, a wml formatted text generated by a script function?

    My wml file:
    <?xml version="1.0"?>
    ...
    <wml>
    <card id="card1">
    ...
    $(text)
    </card>
    </wml>

    My wmls file:
    extern function set_text()
    {
    WMLBrowser.setVar("text", "<a href='myhref'><img src="myimage.wbmp" alt="myimage" /></a>");
    WMLBrowser.refresh();
    }

    But it doesn't work: the image isn't displayed but the text <a href='myhref'><img src="myimage.wbmp" alt="myimage" /></a> is displayed.

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    England
    Posts
    49

    Re: How to write a wml formatted text generated by a script function?

    Try using single quotes to encapsulate your variable name and value.

    WMLBrowser.setVar('text', '<a href="myhref"><img src="myimage.wbmp" alt="myimage" /></a>');


    Or escape your double quotes

    WMLBrowser.setVar("text", "<a href='myhref'><img src=\"myimage.wbmp\" alt=\"myimage\" /></a>");
    Last edited by SimonThomas; 2006-09-16 at 14:14.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    5

    Re: How to write a wml formatted text generated by a script function?

    I have made a mistake: my mlscript file is:
    extern function set_text()
    {
    WMLBrowser.setVar("text", "<a href='myhref'><img src='myimage.wbmp' alt='myimage' /></a>");
    WMLBrowser.refresh();
    }

    But thne problem isn't single or double quote. The problem is that it isn't a image which is displayed, but the characteres :
    <a href='myhref'><img src='myimage.wbmp' alt='myimage' /></a>

Similar Threads

  1. Replies: 7
    Last Post: 2007-12-14, 07:56
  2. Replies: 4
    Last Post: 2005-09-20, 10:10
  3. Replies: 1
    Last Post: 2004-03-14, 21:15
  4. did i need to write a script on server?
    By sumn79 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-02-19, 01:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×