DOM cant raed ajax response

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neeleshv
    New Member
    • Aug 2010
    • 11

    DOM cant raed ajax response

    Hello I had tried so many times but still finding the solution,The Problem is when we use AJAX and get HTML as response,the same response not shows in DOM,Issue is when we try to use response html for further use,It wouldn't be available for some manipulation oj JS call.
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Please include some code (in [code] tags) so we can see what you're doing.

    Comment

    • neeleshv
      New Member
      • Aug 2010
      • 11

      #3
      Code:
      $("input[name='destination[]']").click(function () {
      	# some statement
      	}
          ) 
      
      <body>
      <div id="xyz">
       <input type="checkbox" name="destination[]" value =100"></div>
      its working fine.Now when I append more element
      Code:
      <input type="checkbox" name="destination[]" value =100">
      using AJAX then click on same checkbox the operation doesn't working.
      Last edited by Atli; Aug 27 '10, 11:07 PM. Reason: Fixed the [code] tags.

      Comment

      • neeleshv
        New Member
        • Aug 2010
        • 11

        #4
        Have any idea folk?

        Comment

        • TheServant
          Recognized Expert Top Contributor
          • Feb 2008
          • 1168

          #5
          This is an AJAX problem I think. I don't see any PHP.

          Also, you need to close your [code ] tag's with [/code]

          Comment

          • neeleshv
            New Member
            • Aug 2010
            • 11

            #6
            Thanks dude,But I have done so many time AJAX,So I have Experience in AJAX.Also when u use AJAX response in ur HTML page and then see the view source(FF),You can't see the response HTML.Do u have idea about this?

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              any changes by JavaScript don't show up in the HTML source.

              Comment

              • neeleshv
                New Member
                • Aug 2010
                • 11

                #8
                What do u mean by "any changes by JavaScrip" .I am using ajax response as a html in a div inner html. Now see what,u can not find the same response.

                Comment

                • Dormilich
                  Recognized Expert Expert
                  • Aug 2008
                  • 8694

                  #9
                  that was an answer to:
                  Also when u use AJAX response in ur HTML page and then see the view source(FF),You can't see the response HTML.
                  JavaScript doesn’t interact with the source code (Ctrl+u in FF), it interacts with the document tree.

                  I’m not very familiar with jQuery/prototype, but if you have 2+ elements in your access result, you should use .click() on every element, not the returning list.

                  Comment

                  • neeleshv
                    New Member
                    • Aug 2010
                    • 11

                    #10
                    Thanks for ur time,But still I am not solved my problem.

                    Comment

                    • Dormilich
                      Recognized Expert Expert
                      • Aug 2008
                      • 8694

                      #11
                      try
                      Code:
                      alert($("input[name='destination[]']"));
                      if that gives a NodeList/HTMLCollection or Array you need to apply your .click() handler on each element.

                      Comment

                      Working...