5 Replies Latest reply on Oct 30, 2016 6:32 PM by nic_tunney

    Coldfusion 9/Ajax/Auto include headers




      I have taken over a project and this project is setup that there is always a menu on the top of each html page.  This is fine but I wish to use ajax and if I call a page I want to get raw data passed back to me.  Unfortunately I get the template that has been setup ad the results buried inside.  How do I specify a call not to include all the default header information.  Is there some type of tag to state raw text is coming out, or anything similar.


      Thank you,



        • 1. Re: Coldfusion 9/Ajax/Auto include headers
          WolfShade Level 4

          It depends upon how the site has been coded.


          Some sites use CFINCLUDE in each page to place a navigation or menu on the page.


          Some sites place the nav/menu code (or a CFINCLUDE to it) in the onRequest page, so it loads on every page.


          Some developers will use JavaScript or jQuery to dynamically load the nav/menu.


          In a nutshell, without knowing anything about your site, we can't answer your question.    How is your inherited project laid out?





          • 2. Re: Coldfusion 9/Ajax/Auto include headers
            Dave Ferguson Level 3

            Ideally, your ajax calls should go to to a different location that don't render UI elements.  Adding a bunch of IF conditions around the code just just sloppy and hard to read. 

            • 3. Re: Coldfusion 9/Ajax/Auto include headers
              DavieDonuts Level 1

              Tans for the reply,


              The problem is there is no place where it specifically as for another page like a header.  i am making the assumption that it is setup within the ColdFusion configuration itself.  Is there flag to include this unnecessary information with my ajax call?  st raw output in whatever I deem fit.  I don't want to have to turn it off in the ColdFusion configuration then see if anything is broken.  Any hack would work.




              David Carachelo

              • 4. Re: Coldfusion 9/Ajax/Auto include headers
                WolfShade Level 4

                I am not completely versed with CFAdmin, but I am not aware of any setting in CFAdmin that could be set to automatically include headers, footers, etc.


                So there _must_ be code, somewhere, that includes the extra stuff.  If you're not finding it in CF code, look through ALL the JavaScript and jQuery (if applicable) code to see if there is anything in there that loads the header.





                • 5. Re: Coldfusion 9/Ajax/Auto include headers
                  nic_tunney Adobe Community Professional

                  What endpoint are you calling?  It sounds like it is not restful. Are you calling a CFM page with a header/footer included?  Does the project use a framework that could be including a template?  Are you calling a CFC directly, and if so what returntype and returnformat is being set on the called method?  Without some other information this won't be something we can easily troubleshoot.