Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to transfer a string from cgi at server side to a javascriptfunction at client side as an argument?

Reply
Thread Tools

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

 
 
zxo102
Guest
Posts: n/a
 
      10-12-2009
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'][i]
c = self.response['dbcId'][i]
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Disabling AutoPostBack on Button.Click() to activate Javascriptfunction maximz2005 ASP .Net 1 12-13-2008 05:48 AM
LoginAuthenticate\JavaScriptFunction gh ASP .Net 1 06-11-2008 10:23 PM
Image map: client-side or server-side (cgi)? Luigi Donatello Asero HTML 12 12-24-2003 12:03 PM
how to place a <br> in a javascriptfunction? Fjodor Klondyke Javascript 1 08-03-2003 12:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57