WML programming problems

Need technical advice on coding your web pages? Covers HTML, JavaScript, CSS, and some server side technologies. Also the issue of some webpages not displayed well.

Moderator: Don_HH2K

WML programming problems

Postby murphy79 » Wed 31 Aug, 2005 5:12 am

I have some problems formatting my wap page. I want to write lines looking like this:
My text: link - other link
but when I use tha <a> tag, my wap browser creates a linebreak. I have my text and links inside a <p> tag, but it stil looks like this:
My text:
link
-
other link

Problem 2: I seem to have problems displaying wbmp images in wap browsers. I only get the alt text, even in new phones.
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50215; .NET CLR 1.0.3705)
User avatar
murphy79
junior member
junior member
 
Posts: 16
Joined: Mon 11 Jul, 2005 5:12 pm
Location: Oslo, Norway

Postby Don_HH2K » Wed 31 Aug, 2005 7:28 am

I am not a WAP programmer, but I think that HTML's <a> is relative to WML's <anchor>. I am not sure if both work, but you might try switching the two out.

Instead of [tt]<a href="page.wml">texthere</a>[/tt], try [tt]<anchor>texthere<go href="page.wml" /></anchor>[/tt] instead.

As for your images problem, I take it you are doing something close to [tt]<img src="wirelessbmp.wbmp" alt="texthere" />[/tt]? I am unaware why this would create a problem unless the <img> tag is directed to the wrong spot. Would you be able to post your WML file somewhere, along with the WBMP image?

W3Schools has a WML Validator that may tell you what your problem is if you run your WML file through it.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050728 Donzilla/0.8PR1 (WML/1.3)
Last edited by Don_HH2K on Wed 31 Aug, 2005 7:30 am, edited 1 time in total.
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby murphy79 » Wed 31 Aug, 2005 7:47 am

The <a> tag does not create a linebreak in all wap browsers it seems. maby it is becase my phone is a bit old.

There does not seem to be any errors in my wml page, and the wbmp image is created with photoshop CS2, so the format should be good.
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50215; .NET CLR 1.0.3705)
User avatar
murphy79
junior member
junior member
 
Posts: 16
Joined: Mon 11 Jul, 2005 5:12 pm
Location: Oslo, Norway

Postby Don_HH2K » Wed 31 Aug, 2005 8:27 am

You may want to do some testing with the WMLBrowser project, an add-on for Netscape / Mozilla / Firefox that lets you browse WML pages from those browsers. It should give a good representation of what you'll get on most phones.

Most older phones wrap lines everywhere anyway -- I believe the display resolution on my phone is 96x96 anyway. I know that the latest LG phones run at 320x240, which is where you'd need to worry about constand linebreaking. Of course, those phones have support for other image formats like GIF and JPEG anyway.

This WML deck . . .
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE wml PUBLIC "-//OPENWAVE.COM//DTD WML 1.3//EN" "http://www.openwave.com/dtd/wml13.dtd">
<wml>
  <card id="anchor">
    <anchor>Next page
      <go href="otherpage.wml" />
    </anchor>
  </card>
  <card id="a">
    <a href="otherpage.wml">Some text</a>
  </card>
  <card id="img">
    <img src="image.wbmp" alt="alttext" />
  </card>
</wml>


. . .produces something like this in WMLBrowser:
Image

I believe that WML 2.0 is based on XHTML Mobile 1.0, meaning that the above WML deck would look more like this:
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD WML 2.0//EN" "http://www.wapforum.org/DTD/wml20.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wml="http://www.wapforum.org/2001/wml">
  <head />
  <body>
    <a href="otherpage.wml">Otherpage</a>
    <img src="image.wbmp" alt="alttext" />
  </body>
</html>
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050728 Donzilla/0.8PR1 (WML/1.3)
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm


Return to Web Design and Page Coding

Who is online

Registered users: Google [Bot]