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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:07:57+00:00 2026-06-16T23:07:57+00:00

I’m working on a small project. Mostly to gain some understanding because I am

  • 0

I’m working on a small project. Mostly to gain some understanding because I am a complete web noob. Which may or may not be apparent in the following question(s).

My end result is fetching a bunch of values from a database. Putting them into a JSON object and then using some jQuery/JavaScript to work with the data. I’ve been doing a ton of reading, been through tons of posts on here but I can’t find something as it relates to my problem.

I’m working in VS2010 C#. I’m bound by IE7 on the client side, but I can test with Firefox. I’m also working on localHost for now.

My JavaScript is as follows.

function plotMarkers() {
var pathStart = new String(window.location);
var newPath = pathStart.replace("Default.aspx", "getMarkers.aspx");
alert(newPath);
$("#statusDiv").html('<a href="' + newPath + '">JSON Data</a>');

$.getJSON(newPath, function (data) {

    alert("Loading JSON");
    $.each(data, function (index, elem) {

        var myLatlng = new google.maps.LatLng(elem.lat, elem.lng);
        var marker = new gogle.maps.Marker({
            position: myLatlng,
            title: elem.title
        });

        marker.setMap(map);
    });

}, function () { alert("loaded") });}

I don’t get any Javascript errors in Firefox, but I do in IE7. The alert("Loading JSON") never fires anywhere. I’ve never seen it.

My getMarkers.aspx code

public partial class getMarkers : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        JavaScriptSerializer jsonSer = new JavaScriptSerializer();

        List<marker> markerList = new List<marker>();
        markerList.Add(new marker(-34.397, 150.644, "Test"));
        markerList.Add(new marker(-50, 150.644, "Test2"));

        string sJSON = jsonSer.Serialize(markerList);
        Response.ContentType = "application/json";
        Response.Write(sJSON);
    }
}

I can click the link in “statusDiv” and it takes me to the aspx page. I get an error in IE7 but it works fine in Firefox. The JSON that is parsed back to me in those pages is correct. I copy and pasted the response in another function and the plotter put the two pins on my map.

  1. The code does not seem to enter the $.getJSON function.

  2. There is a problem with IE7 (or a problem in general) with how my getMarkers.aspx is set up. Googled some tutorials and this is where I ended up. I might be completely wrong in my approach. Or I missed something I was supposed to do. I can’t seem to find that specific tutorial, it must have been closed on accident amidst my furious 2 day and counting Google adventure.

Firefox getMarkers.aspx displays the JSON as the first line followed by the html. Just plaintext in the browser.

IE7 displays an XML error and tells me the JSON string isn’t allowed at the top level of the document. I did read some articles about IE7 always trying to parse XML with an elaborate workaround. Which I can’t do, because I don’t know how many clients will be using it. Is there a better way to do what I’m doing?

If anyone could point me in the direction I need to go I would greatly appreciate it. Hopefully my post isn’t too convoluted.

  • 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-16T23:07:59+00:00Added an answer on June 16, 2026 at 11:07 pm

    You probably want a Response.End() at the end of your page load method, so that the rest of the web page isn’t rendered after your JSON.

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have an array which has BIG numbers and small numbers in it. I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm interested in microtypography issues on the web. I want a tool to fix:
I would like to run a str_replace or preg_replace which looks for certain words

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.