How to transfer a string from cgi at server side to a javascriptfunction at client side as an argume

Z

zxo102

Hi everyone,
How can I transfer a string from a cgi at server side to a
javascript function at client side as an argument? Here is my case:

1. client side: javascript in html page:
....
mygrid = new dhtmlXGridObject('gridbox');
........
var cgi3 = "/bop-cgi/xbop";
cgi3 += "?requestIds=[wisco.mProducts.dboProducts.mySearch]";
cgi3 += "&wisco.mProducts.dboProducts.searchString=1=1";

mygrid.loadXML(cgi3);

.........

2. server side cgi: wisco.mProducts.dboProducts.mySearch
....
def mySearch(self):
self.search()
row_count = self.response['rowCount']
myStr = """<rows total_count="%s" pos="%s">"""%
(row_count, 1)
for i in range(len(self.response['dbcCode'])):
a = self.response['dbcCode']
c = self.response['dbcId']
myStr = myStr + "<row id = '%s"%c + "'>"
myStr = myStr + "<cell>" + a + "</cell>"
myStr = myStr + "<cell>%s"%c + "</cell>"
myStr = myStr + "</row>"
myStr = myStr + "</rows>"
....
I want the myStr to be transferred to mygrid.loadXML like:

mygrid.loadXML('<rows total_count="100" pos="1"><row
id="2"><cell>xxxxx</cell></row></rows>')

Any ideas?

Thanks in advance for your help.

ouyang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top