Remote Table connectivity Using Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ms026057
    New Member
    • Sep 2008
    • 4

    Remote Table connectivity Using Javascript

    I Have a File a.html
    file Content
    [HTML]<html>
    <body>
    <table>
    <tr><td id="table1">thi s content from b.html</td></tr>
    </table>
    </body>
    <html>
    [/HTML]
    b.html
    file content
    [HTML]<html>
    <body>
    <table>
    <tr>
    <td id="table2">thi s content should go to a.html table cell</td>
    </tr>
    </table>
    </body>
    </html>
    [/HTML]
    In this case how i shold transfer the data from table id ="table2" from a.html to table id="table1" which is in b.html using javascript code..

    How can i made remote table connectivity??? ???

    Is there is any possible?????
    pls rectify my doubts if there is any javascript experts?????
    Last edited by acoder; Sep 26 '08, 11:08 AM. Reason: Added [code] tags
  • pronerd
    Recognized Expert Contributor
    • Nov 2006
    • 392

    #2
    If the two different files are loaded in frames in the browser at the same time you can use JavaScript to pass data from one to the other. If on the other hand you are wanting to pass data to a page that is not loaded in the browser JavaScript can not do that.

    Passing data from one page to another would require a server side language like Java, PHP, ASP, etc.

    Comment

    • Rsmastermind
      New Member
      • Sep 2008
      • 93

      #3
      If anyone wants to pass contents of one to another then for example these are the possible cases:

      Case1:If a.html has opened b.html then the data of b.html can be passed to a.html.

      Case2:If a.html and b.html are in the two of the different frames of the same window.


      Then you can pass the thing in chain like using the object top.opener.docu ment and top.frame['name of the frame']


      other Java can help you in other case.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        There's two other possibilities which are limited, but possible with a small amount of data. One is cookies and the other is passing through the URL when opening the other page which can then be parsed using the String methods on location.search .

        Comment

        • Rsmastermind
          New Member
          • Sep 2008
          • 93

          #5
          Yes acoder that is the thing as he had told he want to parse the table so this can be achieved through the two possible case which I had posted in the previous post.location.s earch and cookies can't handle a table having 5 or 6 rows and more than 3 columns.

          Comment

          • rnd me
            Recognized Expert Contributor
            • Jun 2007
            • 427

            #6
            Originally posted by Rsmastermind
            Yes acoder that is the thing as he had told he want to parse the table so this can be achieved through the two possible case which I had posted in the previous post.location.s earch and cookies can't handle a table having 5 or 6 rows and more than 3 columns.

            you don't need frames or loaded pages at all.

            simply ajax in "b.htm", set a new tag's .innerHTML to the responseText, find the table in the new tag using getElementsByTa gName, clone the nodes, and append them into the mater table.

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Heh, how could I forget that? ;)

              The fifth possibility probably being the "best".

              Comment

              • Rsmastermind
                New Member
                • Sep 2008
                • 93

                #8
                Yes of course rnd that is fine .I was trying to do only it with javascript.As also I dont know much about the ajax utilities.

                Comment

                Working...