Skip to main content
Known Participant
November 27, 2008
Question

A submenu with cf

  • November 27, 2008
  • 1 reply
  • 268 views
Hi,

I have a submenu on a page and I want the user to choose an option without re-sending the current page.

I was going to use the ajax load function in Jquery,( http://docs.jquery.com/Ajax/load#urldatacallback) but the amount of users with javascript turned off makes me a bit nervous. Im using CF8 and was wondering if there is a CF8 way to load my html into a div without sending the current page?

    This topic has been closed for replies.

    1 reply

    November 28, 2008
    I'm afraid what you're asking is impossible without JavaScript. ColdFusion is server side code, the browser thus needs to request from the server what it wants via loading a page. You can use Ajax to do this without a page refresh, but Ajax is JavaScript...so, yeah.

    Create your menu the normal page refresh way, the way forms were meant to work. THEN, add on some JavaScript to submit onchange via Ajax. This way, if the user has JS off, they'll just get the old method instead.

    It's called "unobtrusive" use of JavaScript. Where both options are available.

    Mikey.