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

  • SEARCH
  • Home
  • 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 7874361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:47:30+00:00 2026-06-03T02:47:30+00:00

So here’s the problem. I have three pages that make web service calls. The

  • 0

So here’s the problem. I have three pages that make web service calls. The first time I land on the page and make the call it works fine, however if I switch to the second page it tries to make a web service call to the wrong service. Here’s some info:

pages:

Page1.aspx - has Page1.js
Page2.aspx - has Page2.js

js files:

Page1.js

var filterCriteria = "";

function GetList() {
    $.ajax({
        type: "POST",
        url: "/webServices/Page1.asmx/Page1List",
        contentType: "application/json; charset=utf-8",
        data: "{'letter':'" + filterCriteria + "'}",
        dataType: "json",
        success: function (result) {
            DisplayList(result.d);
        }
    });
}

function GetSearchResults() {
    $.ajax({
        type: "POST",
        url: "/webServices/Page1.asmx/Page1FilteredList",
        contentType: "application/json; charset=utf-8",
        data: "{'searchCriteria':'" + $("#Search").val() + "'}",
        dataType: "json",
        success: function (result) {
            DisplayList(result.d);
        }
    });
}

function DisplayList(object) {
    var html = '';
    for (var i = 0; i < object.length; i++) {
     //format results and append
    }
    if (object.length == 0) {
        html += "<li class=\"filteredList\" style=\"padding: 10px;\">No Results Found</li>";
    }
    $("#Page1List").html(html);
}

Page2.js

var filterCriteria = "";

function GetList() {
    $.ajax({
        type: "POST",
        url: "/webServices/Page2.asmx/Page2List",
        contentType: "application/json; charset=utf-8",
        data: "{'letter':'" + filterCriteria + "'}",
        dataType: "json",
        success: function (result) {
            DisplayList(result.d);
        }
    });
}

function GetSearchResults() {
    $.ajax({
        type: "POST",
        url: "/webServices/Page2.asmx/Page2FilteredList",
        contentType: "application/json; charset=utf-8",
        data: "{'searchCriteria':'" + $("#Search").val() + "'}",
        dataType: "json",
        success: function (result) {
            DisplayList(result.d);
        }
    });
}

function DisplayList(object) {
    var html = '';
    for (var i = 0; i < object.length; i++) {
     //format results and append    
    }
    if (object.length == 0) {
        html += "<li class=\"filteredList\" style=\"padding: 10px;\">No Results Found</li>";
    }
    $("#Page2List").html(html);
}

So both have the same calls and the same information and the only real difference is that the results are different and they make a web service call to different web services that get different data.

Now each time that I switch between I get a new js file which is

jQuery-1.7.1.min.js/eval/seq/1
jQuery-1.7.1.min.js/eval/seq/2
jQuery-1.7.1.min.js/eval/seq/3
jQuery-1.7.1.min.js/eval/seq/4

depending on how many times I switch back an forth. Is there any way to stop the eval or is there something in my code that is causing the jQuery to store evals of the code I am using and what can I do to resolve it?

  • 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-06-03T02:47:31+00:00Added an answer on June 3, 2026 at 2:47 am

    So the problem was that I was loading page transitions from jquery mobile. What was happening was that jquery mobile appends new page data to the DOM instead of forcing a page load. This was causing both javascript files to be loaded simultaneously meaning that which ever js file was loaded last was the primary and because both js files were calling functions with the same name it would load them multiple times.

    Resolution
    remove the $.mobile.load() event and force the click event to append the pathname to the url

    $("#GoPage1").on("click", function () { window.location = "/dir/Page1.aspx"; });
    $("#GoPage2").on("click", function () { window.location = "/dir/Page2.aspx"; });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the problem....I have three components...A Page that contains a User Control and a
Here is my code (Say we have a single button on the page that
Here's the situation, i want to have a user that can enter time on
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Here is my problem : I have a post controller with the action create.
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here's a coding problem for those that like this kind of thing. Let's see
Here is another spoj problem that asks how to find the number of distinct

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.