Texis URL in javascript

barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Texis URL in javascript

Post by barry.marcus »

Mark, I know John's reply was well-intentioned, but frankly I have no idea what he means by that, and that is basically my issue... I know that the function called by the Javascript has to produce *something* (ideally XML) that will be seen by the calling javascript when the function returns, but that is precisely what have spent all this time trying to implement. But I am clearly missing something. I am using the code that you provided and it runs without errors. But it displays nothing, clearly because the showmsg function is missing and/or incorrect. Do you have code for the showmsg function?
barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Texis URL in javascript

Post by barry.marcus »

As a test, I want to implement something like the following to produce return XML:

<a name=showmsg PUBLIC>
<capture>
<$writer = (xmlWriterNewToString(''))>
<$ret = (xmlWriterStartDocument($writer, '1.0'))>
<$ret = (xmlWriterStartElement($writer, 'rootnode'))>

<$ret = (xmlWriterStartElement($writer, 'row'))>
<$ret = (xmlWriterWriteElement($writer, 'id' , '1111111'))>
<$ret = (xmlWriterWriteElement($writer, 'Title' , 'The First Title'))>
<$ret = (xmlWriterWriteElement($writer, 'IssueDate' , '1/1/2014'))>
<$ret = (xmlWriterWriteElement($writer, 'DocID' , 'TheFirstDocId'))>
<$ret = (xmlWriterWriteElement($writer, 'Assignee' , 'The first assignee name'))>
<$ret = (xmlWriterEndElement($writer))>

<$ret = (xmlWriterStartElement($writer, 'row'))>
<$ret = (xmlWriterWriteElement($writer, 'id' , '2222222'))>
<$ret = (xmlWriterWriteElement($writer, 'Title' , 'The Second Title'))>
<$ret = (xmlWriterWriteElement($writer, 'IssueDate' , '2/1/2014'))>
<$ret = (xmlWriterWriteElement($writer, 'DocID' , 'TheSecondDocId'))>
<$ret = (xmlWriterWriteElement($writer, 'Assignee' , 'The second assignee name'))>
<$ret = (xmlWriterEndElement($writer))>

<$ret = (xmlWriterEndDocument($writer))>
</capture>
<$output = (xmlWriterGetContent($writer))>
<return $output>
</a>

I've also tried modifying the onreadystatechange function you provided with something like the following:

if(xmlhttp.readyState==4){
if(xmlhttp.status==200){
var i;
var xmlDoc=xmlhttp.responseXML;
var txt="";
var x=xmlDoc.getElementsByTagName("Title");
<verb noesc>for (i=0;i<x.length;i++) {</verb>
txt=txt + x[i].childNodes[0].nodeValue + "<br>";
}
document.getElementById("moremsgscontainer").innerHTML=txt;
}
}


Again, nothing displays. It's very frustrating that something so seemingly simple is not working for me.
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Texis URL in javascript

Post by mark »

As John said, you need to print the output not <return> it. <send $output>
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Texis URL in javascript

Post by mark »

barry.marcus
Posts: 288
Joined: Thu Nov 16, 2006 1:05 pm

Texis URL in javascript

Post by barry.marcus »

Thank you! That was the key that I was missing in all of this. It is working perfectly now!
Post Reply