Groups > IBM > ibm.software.speech.multimodal > Re: javascript execution in multimodal pages (mxml)




Re: javascript execution in multimodal pages (mxml)

Re: javascript execution in multimodal pages (mxml)
Fri, 28 Jul 2006 09:36:18 -040
I believe that as of Opera 8, document.write() does not work in X+V 
files. It does however work in the older voice enabled Opera 7.55 which 
can be downloaded from the IBM mulitmodal web site.

Post Reply
Re: javascript execution in multimodal pages (mxml)
Fri, 28 Jul 2006 10:27:26 -040
Jaime Botella wrote:
> On Fri, 28 Jul 2006 15:36:18 +0200, Marc White <whitemar@us.ibm.com>
wrote:
> 
>> I believe that as of Opera 8, document.write() does not work in X+V  
>> files. It does however work in the older voice enabled Opera 7.55 
>> which  can be downloaded from the IBM mulitmodal web site.
>>
>>    http://www.ibm.com/pvc/multimodal
> 
> 
> Hello Marc,
> 
> Do you know if there's any workaround (equivalent method that I can use  
> instead of document.write()) with the new Opera versions ?
> 
> Thanks,
>         Jaime

I am not aware of any document.write() equivalents. You may get a better 
answer by posting your question on the Opera forums:

Post Reply
javascript execution in multimodal pages (mxml)
Fri, 28 Jul 2006 12:11:30 +020
Hi all,

I'm writing a small multimodal application that should welcome an already  
identified user (see the initial code below).

The problem I have is that if I name this page: welcome_page.mxml, the  
"document.write()" code, apparently does not execute.
On the other hand, if I name it: welcome_page.html, I get the messages  
written, but I get no voice.

Any recommendation?

Thanks,
    Jaime.


Note: I'm testing it using Opera:
	Version  9.00
	Build    8502
	Platform Win32
	System  Windows XP
	Java    Sun Java Runtime Environment version 1.5
	XHTML+Voice IBM Multimodal Runtime Environment, Version: 4.1.3, Build:  
20050506.01.



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//VoiceXML Forum//DTD XHTML+Voice 1.2//EN" 

"http://www.voicexml.org/specs/multimodal/x+v/12/dtd/xhtml+voice12.dtd"
;>
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:vxml="http://www.w3.org/2001/vxml"
     xmlns:ev="http://www.w3.org/2001/xml-events"
     xmlns:xv="http://www.voicexml.org/2002/xhtml+voice"
     xml:lang="en-US">

<head>
	<script type="application/ecmascript"
src="mainfuncs.script"></script>
       <script language="javascript"
type="application/javascript"  
src="login.js"></script>

	<script language="JavaScript">
	  checkCookie();
	   title = getCookie("title");
	   name  = getCookie("name");
	   gender  = getCookie("gender");
	   var welcome = "";
	   if(gender == "male")
	      welcome = "Bienvenido, ";
            else
	      welcome = "Bienvenida, ";
	   welcome += title + " " + name + ".";
	   document.write("<title>" + welcome +
"</title>");
	   document.write("<h2>" + welcome + "</h2>");
   	</script>

         <vxml:form id="welcome_vform">
             <vxml:block>
                 <vxml:prompt>
			<vxml:value expr="welcome" />
                 </vxml:prompt>
             </vxml:block>
         </vxml:form>


     </head>

     <body id="main_body" ev:event="load"
ev:handler="#welcome_vform">


     </body>
</html>


-- 
Post Reply
Re: javascript execution in multimodal pages (mxml)
Fri, 28 Jul 2006 14:47:08 +020
On Fri, 28 Jul 2006 14:16:11 +0200, Mihai Sucan <mihai.sucan@gmail.com>  
wrote:

> Hello!
>
> Le Fri, 28 Jul 2006 13:11:30 +0300, Jaime Botella
<jimbotel@gmail.com> a  
> écrit:
>
>>
>> Hi all,
>>
>> I'm writing a small multimodal application that should welcome an  
>> already identified user (see the initial code below).
>>
>> The problem I have is that if I name this page: welcome_page.mxml, the 

>> "document.write()" code, apparently does not execute.
>> On the other hand, if I name it: welcome_page.html, I get the messages 

>> written, but I get no voice.
>>
>> Any recommendation?
>>
>> Thanks,
>>     Jaime.
>>
>>
>> Note: I'm testing it using Opera:
>> 	Version  9.00
>> 	Build    8502
>> 	Platform Win32
>> 	System  Windows XP
>> 	Java    Sun Java Runtime Environment version 1.5
>> 	XHTML+Voice IBM Multimodal Runtime Environment, Version: 4.1.3, Build:
 
>> 20050506.01.
>
> You have to save it as .mxml.
>
> However, there are some corrections to be done:
>
>   <?xml version="1.0" encoding="iso-8859-1"?>
>   <!DOCTYPE html PUBLIC "-//VoiceXML Forum//DTD XHTML+Voice
1.2//EN"
>  
"http://www.voicexml.org/specs/multimodal/x+v/12/dtd/xhtml+voice12.dtd"
;>
>   <html xmlns="http://www.w3.org/1999/xhtml"
>        xmlns:vxml="http://www.w3.org/2001/vxml"
>        xmlns:ev="http://www.w3.org/2001/xml-events"
>        xmlns:xv="http://www.voicexml.org/2002/xhtml+voice"
>        xml:lang="en-US">
>
>   <head>
>   	<script type="application/ecmascript"
src="mainfuncs.script"></script>
>        <script type="application/javascript"
src="login.js"></script>
>
>   	<script type="application/javascript">
> 	/* <![CDATA[ */
>   	  checkCookie();
>   	   title = getCookie("title");
>   	   name  = getCookie("name");
>   	   gender  = getCookie("gender");
>   	   var welcome = "";
>   	   if(gender == "male")
>   	      welcome = "Bienvenido, ";
>           else
>   	      welcome = "Bienvenida, ";
>   	   welcome += title + " " + name + ".";
>   	   document.write("<title>" + welcome +
"</title>");
>   	   document.write("<h2>" + welcome +
"</h2>");
> 	/* ]]> */
>      	</script>
>
>            <vxml:form id="welcome_vform">
>                <vxml:block>
>                    <vxml:prompt>
>    			  <vxml:value expr="welcome" />
>                    </vxml:prompt>
>                </vxml:block>
>            </vxml:form>
>
>        </head>
>
>        <body id="main_body" ev:event="load"
ev:handler="#welcome_vform">
>
>
>        </body>
>   </html>
>
> The important change is: use CDATA section. This is for obeying the XML  
> syntax rules. See:
> http://www.w3.org/TR/xml/#sec-cdata-sect
>
> If this doesn't work, let me know.
>
>


Unfortunately, it didn't work, at least for me. I get the same results  
with and without the <script type="application/javascript"> and
the CDATA  
addings.


-- 
Thanks,
Post Reply
Re: javascript execution in multimodal pages (mxml)
Fri, 28 Jul 2006 15:16:11 +030
Hello!

Le Fri, 28 Jul 2006 13:11:30 +0300, Jaime Botella <jimbotel@gmail.com> a 

écrit:

>
> Hi all,
>
> I'm writing a small multimodal application that should welcome an  
> already identified user (see the initial code below).
>
> The problem I have is that if I name this page: welcome_page.mxml, the  
> "document.write()" code, apparently does not execute.
> On the other hand, if I name it: welcome_page.html, I get the messages  
> written, but I get no voice.
>
> Any recommendation?
>
> Thanks,
>     Jaime.
>
>
> Note: I'm testing it using Opera:
> 	Version  9.00
> 	Build    8502
> 	Platform Win32
> 	System  Windows XP
> 	Java    Sun Java Runtime Environment version 1.5
> 	XHTML+Voice IBM Multimodal Runtime Environment, Version: 4.1.3, Build:  
> 20050506.01.

You have to save it as .mxml.

However, there are some corrections to be done:

  <?xml version="1.0" encoding="iso-8859-1"?>
  <!DOCTYPE html PUBLIC "-//VoiceXML Forum//DTD XHTML+Voice
1.2//EN"
 
"http://www.voicexml.org/specs/multimodal/x+v/12/dtd/xhtml+voice12.dtd"
;>
  <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:vxml="http://www.w3.org/2001/vxml"
       xmlns:ev="http://www.w3.org/2001/xml-events"
       xmlns:xv="http://www.voicexml.org/2002/xhtml+voice"
       xml:lang="en-US">

  <head>
  	<script type="application/ecmascript"
src="mainfuncs.script"></script>
       <script type="application/javascript"
src="login.js"></script>

  	<script type="application/javascript">
	/* <![CDATA[ */
  	  checkCookie();
  	   title = getCookie("title");
  	   name  = getCookie("name");
  	   gender  = getCookie("gender");
  	   var welcome = "";
  	   if(gender == "male")
  	      welcome = "Bienvenido, ";
          else
  	      welcome = "Bienvenida, ";
  	   welcome += title + " " + name + ".";
  	   document.write("<title>" + welcome +
"</title>");
  	   document.write("<h2>" + welcome +
"</h2>");
	/* ]]> */
     	</script>

           <vxml:form id="welcome_vform">
               <vxml:block>
                   <vxml:prompt>
   			  <vxml:value expr="welcome" />
                   </vxml:prompt>
               </vxml:block>
           </vxml:form>

       </head>

       <body id="main_body" ev:event="load"
ev:handler="#welcome_vform">


       </body>
  </html>

The important change is: use CDATA section. This is for obeying the XML  
syntax rules. See:
http://www.w3.org/TR/xml/#sec-cdata-sect

If this doesn't work, let me know.


-- 
ROBO Design - We bring you the future
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact