Announcement

Collapse
No announcement yet.

Tutorial: AJAX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    just a little note about my original code, this section.
    HTML Code:
            //alert (xmlHttp.responseText);
    
              if(divID=="dispcontent") {
              document.getElementById(divID).innerHTML = xmlHttp.responseText;
              }
              else {
                if(document.getElementById(divID).innerHTML=="") {
                    document.getElementById(divID).innerHTML = xmlHttp.responseText;
                    }
                else {
                document.getElementById(divID).innerHTML = "";
                }
    isnt really required.

    this code was pulled from something else. it can easily be trimmed to:
    HTML Code:
                if(document.getElementById(divID).innerHTML=="") {
                    document.getElementById(divID).innerHTML = xmlHttp.responseText;
                    }
                else {
                document.getElementById(divID).innerHTML = "";
                }
    and if you dont want it to toggle, that is to say, a simple link that makes the content stay, you'll just do this:
    HTML Code:
                    document.getElementById(divID).innerHTML = xmlHttp.responseText;



    *and*

    for those that want the item to automatically populate, add trigger the code just after your container DIV.

    HTML Code:
    <script>ajaxGetPage('<actinic:variable name="CatalogURL" /><actinic:variable name="ExtendedInfoPageName" />','mytarget')</script>

    Comment


      #17
      and if you want to have the target div hidden (e.g. so bgcolors and borders dont show when it's empty) then could you not use

      Code:
      			if(document.getElementById(divID).innerHTML=="") {
      				document.getElementById(divID).innerHTML = xmlHttp.responseText;
      				document.getElementById(divID).style.visibility = 'visible';
      				}
      			else {
      			document.getElementById(divID).innerHTML = "";
      			document.getElementById(divID).style.visibility = 'hidden';
      			}

      and set the original div to something like

      Code:
      <div id="mytarget" style="visibility:hidden;"></div>
      Fergus Weir - teclan ltd
      Ecommerce Digital Marketing

      SellerDeck Responsive Web Design

      SellerDeck Hosting
      SellerDeck Digital Marketing

      Comment


        #18
        well now, isnt actinic looking more web 2.0 by the moment!

        Comment


          #19
          well now, isnt actinic looking more web 2.0 by the moment!
          I'd love the latest version to look more like Web 1.0 at the moment

          Comment


            #20
            I've just come back because I intend to use this - to find you've all gone beserk!

            Up to Fergus's step by step, fair enough. Thanks, F, for you prompt response last night, I intend to implement this on a live site this week-end.

            But the enhancements that follow will need considerable refinement I fear.
            Paul
            Flower-Stands.co.uk - the UK's largest online supplier of Fresh Flower Merchandising Stands

            Using V10.2 with Norman's brilliantly simple TABBER.

            Comment


              #21
              But the enhancements that follow will need considerable refinement I fear.
              Its just a starting point, but in keeping with Actinic, most enhancements need tweeking

              Comment


                #22
                Sorry folks, completely lost. I'm sure this is very easy but I'm only a simple sailor.

                I've lost track of where I stick all this stuff, in templates, .js code, fragments, ugh.

                Am I right in thinking that I need to:
                1. add some code to a .js files somewhere
                2. create a new template
                3. add into that template a call to the code I want displayed, e.g. http://www.citnexus.co.uk/ourfaqs/index.html

                Then this code will display within the Actinic page without reloading AND when links in this code are clicked they will also remain on the same page?

                Or am I being stupid as usual!

                Comment


                  #23
                  Many thank to Gabriel for this exellent post.
                  Using Ajax I've been able to incorporate some PHP I've been working on and produce this page:

                  http://www.greenknightgames.co.uk/ac...All_Games.html

                  (I know the lists aren't in alpha order - I'm working on that)

                  Comment


                    #24
                    Right

                    Quick Q

                    had a look on the example from Alan

                    what we want to bring back is a customvar on the products. can the split be done based on that?

                    also can it bring back the main image of the product?

                    Comment


                      #25
                      Originally posted by fergusw
                      You can see it in Actinic working here:

                      http://www.teclan.com/AJAX/acatalog/Books.html
                      Did you remove it? When I go to that page I don't see anything... no products listed in that section.
                      John

                      Comment


                        #26
                        We took it down temporarily - I'll see if I can throw it back up for you
                        Fergus Weir - teclan ltd
                        Ecommerce Digital Marketing

                        SellerDeck Responsive Web Design

                        SellerDeck Hosting
                        SellerDeck Digital Marketing

                        Comment


                          #27
                          Originally posted by fergusw
                          I'll see if I can throw it back up for you
                          last night must have been a good(bad) night?
                          Tracey

                          Comment


                            #28
                            Hmmmmmm Good Bad Night, depends on the way you see things

                            Comment


                              #29
                              Originally posted by fergusw
                              We took it down temporarily - I'll see if I can throw it back up for you
                              Hey, that is kind of cool. Not sure I'd want it on my product pages, but it is supposed to be pretty useful when used during the checkout procedure - has anyone done that yet? Maybe something for v9 checkout...?
                              John

                              Comment


                                #30
                                OK - back up now
                                Fergus Weir - teclan ltd
                                Ecommerce Digital Marketing

                                SellerDeck Responsive Web Design

                                SellerDeck Hosting
                                SellerDeck Digital Marketing

                                Comment

                                Working...
                                X