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

Discussion in 'Python' started by zxo102, Oct 12, 2009.

  1. zxo102

    zxo102 Guest

    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
    zxo102, Oct 12, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    5,552
  2. gh
    Replies:
    1
    Views:
    428
    bruce barker
    Jun 11, 2008
  3. maximz2005
    Replies:
    1
    Views:
    512
    maximz2005
    Dec 13, 2008
  4. Jim
    Replies:
    1
    Views:
    772
    Aaron Bertrand - MVP
    Jan 28, 2004
  5. Fjodor Klondyke

    how to place a <br> in a javascriptfunction?

    Fjodor Klondyke, Aug 3, 2003, in forum: Javascript
    Replies:
    1
    Views:
    94
    Lasse Reichstein Nielsen
    Aug 3, 2003
Loading...

Share This Page