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 5990075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:11:31+00:00 2026-05-22T23:11:31+00:00

This is for a single page, mobile web-app…. For readability I’ve been concatenating my

  • 0

This is for a single page, mobile web-app….

For readability I’ve been concatenating my html, then injecting. I’m pretty certain there’s a more efficient way, and would like to get a js expert’s opinion!

heres an example of one of my concatenated html strings…

var html_str = '';
$.each(events_array, function(k, ev_type){
    if( localStorage.getItem('show_type'+ev_type.type_num) !== 'false' ){        
        $.each(ev_type, function(k2, e){
            if(typeof e != 'string'){
                if(fav_mode && last_date_num != e.date){
                    html_str += '<li class="date">'+e.date_text+'</li>';
                    last_date_num = e.date;
                }
                html_str += '<li';
                if(fav_mode | (FAVOURITES && $.inArray(parseInt(e.event_id), FAVOURITES) >= 0) ){
                    html_str += ' class="fav"';
                }
                html_str += '>';
                html_str +=     '<div class="l_'+e.gig_club+'"></div>';
                html_str +=     '<p rel="'+e.event_id+'"><span>'+e.venue+' : </span>'+e.nameofnight+'</p>';
                html_str += '</li>';                 
            }                         
        });
    }
});
return html_str
  • 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. Editorial Team
    Editorial Team
    2026-05-22T23:11:31+00:00Added an answer on May 22, 2026 at 11:11 pm

    There is no “Fastest”. There is only “Fastest” for a browser.

    There are 3 common techniques. HTML string manipulation, templating and DOM manipulation.

    Because templating can use both HTML string manipulation and the DOM internally I would recommend it for readability / maintainability.

    Here are a few benchmarks

    Templating

    More templating

    Templating with data for mobile platforms

    Loads of templates

    Dust js benchmark

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

Sidebar

Related Questions

My jQuery Mobile app consists of a single index.html page and contains only one
I think I read every single web page relating to this problem but I
I am trying to develop the single page in asp.net web mobile application as
Background: I'm working on a single page web app that loads everything through AJAX
I have a single page jQuery Mobile app with four data-role='pages' in place; so,
I'm working on a mobile website (it's not a single page app) which has
I want to create a single page such as this: http://www.mywebsite.com/special/index.html But anything in
So I currently have three unordered lists in my header. This is a single-page
this wiki page gave a general idea of how to convert a single char
Never seen this before in ASP.NET development. I'm trying to refactor out 40 single-page

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.