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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:01:27+00:00 2026-05-25T01:01:27+00:00

I am currently using jTemplate and jQuery to get airport data from a web

  • 0

I am currently using jTemplate and jQuery to get airport data from a web service and display it. On one page, it works as expected and it works very well:

function getData(pageSize, pageNumber, filter) {
        if ($('#airportfilter').val() != 'Filter...') {
            defaultParameters = "{pageSize:" + pageSize + ",pageNumber:" + pageNumber + ",filter:'" + filter + "'}";
        }
        else {
            defaultParameters = "{pageSize:" + pageSize + ",pageNumber:" + pageNumber + ",filter:''}";
        }
        loader(true);
        var cachekiller = Math.floor(Math.random() * 1000);
        $.ajax({
            type: "POST",
            url: "http://<%=Atomic.UI.Helpers.CurrentServer()%>/AtomicService/Cog.asmx/GetAirports",
            data: defaultParameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: (function Success(data, status) {
                $('#placeholder').setTemplateURL('/templates/html/airports.htm?ck=' + cachekiller, null, { filter_data: false });
                $('#placeholder').processTemplate(data.d[0]);
                loader(false);
                setPageNumber(pageSize);
            }),
            error: (function Error(request, status, error) {
                $("#placeholder").html(request.statusText).fadeIn(1000);
                loader(false);
            })
        });
    }

This is the template:

<li style="overflow:auto;">
    <ol class="pager">
    {#for index = 1 to Math.ceil($T.TotalRecords/$T.PageSize)}
        <a href="#" id="{$T.index}" class="pagethis"><li {#if $T.index == $T.PageNumber+1 } class="selected"{#/if}>{$T.index}</li></a>
    {#/for}
    </ol>
</li>
{#foreach $T.AirportList as Airport}
<li class="airport-row">
    <div class="gowalla-avatar">
        <a href="/airport/airport.aspx?airport={toLower($T.Airport.Icao)}">
            <img src="{$T.Airport.GowallaImgSmall}" alt="{$T.Airport.AirportName}" title="{$T.Airport.AirportName}" width="100" height="100" border="0"></img>
        </a>
    </div>
    <div class="gowalla-spot">
        <a class="gowalla-name" href="/airport/airport.aspx?airport={toLower($T.Airport.Icao)}">{$T.Airport.AirportName}&nbsp;({$T.Airport.Iata})</a>
        <small>
            <img src="/images/iconography/marker-tiny.png" alt="" class="padtop tinyicon"></img><a href="/city/city.aspx?city={$T.Airport.CityId}">{$T.Airport.City}</a>, <a href="/country/country.aspx?country={$T.Airport.CountryId}">{$T.Airport.Country}</a><br />
            <a href="#" id="flyfromhere">Fly from here &raquo;</a>&nbsp;|&nbsp;<a href="#" id="flytohere">Fly to here &raquo;</a>
        </small>

    </div>
</li>
{#/for}
<li style="overflow:auto;">
    <ol class="pager">
    {#for index = 1 to Math.ceil($T.TotalRecords/$T.PageSize)}
        <a href="#" id="{$T.index}" class="pagethis"><li {#if $T.index == $T.PageNumber+1 } class="selected"{#/if}>{$T.index}</li></a>
    {#/for}
    </ol>
</li>

So on another page where I’d like to get the same data, but where I may use more than one AJAX calls to templates etc, I get this:

Uncaught 5

The code is almost identical:

function getAirportData(pageSize, pageNumber, filter) {
        defaultParameters = "{pageSize:" + pageSize + ",pageNumber:" + pageNumber + ",filter:''}";
        airportLoader(true);
        var cachekiller = Math.floor(Math.random() * 1000);
        $.ajax({
            type: "POST",
            url: "http://<%=Atomic.UI.Helpers.CurrentServer()%>/AtomicService/Cog.asmx/GetAirports",
            data: defaultParameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: (function Success(data, status) {
                $('#airports-placeholder').setTemplateURL('/templates/html/airports.htm?ck=' + cachekiller, null, { filter_data: false });
                $('#airports-placeholder').processTemplate(data.d[0]);
                airportLoader(false);
                //setPageNumber(pageSize);
            }),
            error: (function Error(request, status, error) {
                $("#airports-placeholder").html(request.statusText).fadeIn(1000);
                airportLoader(false);
            })
        });
    }

It uses the same jTemplate and I have checked the web service is returning data etc. It is:

enter image description here

I’ve never seen the Uncaught 5 error before. It occurs in all browsers. I have tried making calls to the service with the filter parameter set as filter: 'xxx' and filter:'' with no change in behaviour. It’s very strange and I’m not sure – without more information from the error – how to solve it!? Any clues?

Help appreciated.

  • 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-25T01:01:27+00:00Added an answer on May 25, 2026 at 1:01 am

    The answer to this was ridiculously simple and I wasted far too long it. sigh Isn’t it always the way?

    Within the template, I had a call to {toLower($T.Airport.Icao)}. The toLower wasn’t a function within the new page. Once I added the function, all was well. slaps head

    Thanks to 65Fbef05 for the help 🙂

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

Sidebar

Related Questions

I'm currently using jquery ajax to call a pagemethod (which works great); $.ajax({ type:
I'm currently attempting to retrieve a list of objects from my database using jQuery.
I'm using the jQuery template plugin to generate HTML from JSON data which the
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I'm about 1 day old in using jquery, and is currently having a nightmare
i'm having a javascript function using jquery: my.namespace.loadSomeStuff = function() { $.get('/Services/loadStuff', function(c){ $(#stuffDiv).html(c);
I'm using Rails with jQuery, and I'm working on a page for a simple
I'm running the latest Rails 2-3-stable branch (currently 2.3.3). I'm using JQuery to post
I'm currently generating a list using the jQuery tmpl plugin : <script id=mainTemplate type=text/x-jquery-tmpl>

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.