Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:01:48+00:00 2026-05-10T19:01:48+00:00

What are some strategies to achieve code separation in AJAX applications? I am building

  • 0

What are some strategies to achieve code separation in AJAX applications?

I am building a PHP application that I would like to have a nice AJAX front end on. I have long since learned to use some kind of templating in my PHP code to make sure I maintain good separation between my logic and display code, but I’m having trouble finding good ways to do this with the JavaScript code on the front end. I’m using jQuery to make the fetching of XML data and DOM manipulation easy, but I’m finding that the logic and layout code is starting to intermix.

The real problem is that I get XML data from the back end that then has to be reformatted and helpful text has to be wrapped around it (directions and the like). I’ve thought about sending over already formatted HTML, but that would require extensive reworking of the backend, and there must be a better way than what I have come up with on my own.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:01:49+00:00Added an answer on May 10, 2026 at 7:01 pm
    • write your templates in the HTML page, probably within a hidden element.
    • fetch data via AJAX calls, i find easier to use JSON, so you don’t have to ‘reformat’ XML, it’s only data.
    • apply the template to the data to generate HTML and insert into the displayed page.

    check some jQuery templating plugins: jsRepeater, jTemplates, noTemplate, Template

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple Player class in java that uses some strategies object
What are some strategies that people have had success with for maintaining a change
Some setup background first: I have a cronjob which runs a PHP file called
I'd like help on some strategies to sequence some animations. I subclassed UIImageView so
So I have an Application that involves sending emails through an API. What I
I'm building an application against a legacy database that stores lookup values in a
I'm wondering what are some strategies that you've come up when dealing with this.
Let's say I have a legacy application that, for various reasons, previous developers decided
Looking for some branching strategies for a situation that has come up for a
we have an app for iPhone and Android. And we would like to internationalize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.