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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:22:41+00:00 2026-06-01T08:22:41+00:00

I have a very strange problem in which identical pieces of Javascript are behaving

  • 0

I have a very strange problem in which identical pieces of Javascript are behaving differently when being provided from different sources. The code is at the bottom of this post.

The page this code is being used on is composed from two distinct sources: a standard view file and content (markup) from a database. The composition is done on the server side and sent to the client as unified document. So as far as the client is concerned, the page is the same.

The problem I’m having is this: when placed in the view file, the code executes normally and behaves as expected. However, when placed in the database, the browser reports missing } after function body.

The code in the database and the view file is identical. There is a single difference: when being placed in the database, all line breaks (\n) are removed. Could this be the problem? If not, has anybody seen this kind of issue before?

var rssTimeout = setTimeout(GetRSSFeed, 300000);
$(document).ready(function () {
    GetRSSFeed();
});

var GetRSSFeed = function () {
    var feedProxyURL = "http://localhost/BusinessLogicAPI/api/Proxy/RSSFeed?URL=http://feeds.bbci.co.uk/news/rss.xml";
    $.ajax({ url: feedProxyURL,
        type: "GET",
        dataType: "xml",
        success: function (data) {
            var xmData = $(data);

            //For the first 5 stories,
            //build some JSON data and give it to the templates
            xmData.children("rss")
                .children("channel")
                .children("item")
                .slice(0, 5)
                .each(function (I, E) {
                    var json = {};
                    json.title = $(E).children("title").text();
                    json.description = $(E).children("description").text();

                    $("#newsTemplate").tmpl(json).appendTo("#newsFeed");
                });
        },
        error: function () {
            $("#newsFeed").html("<span>Could not open feed</span>");
        }
    });
    rssTimeout = setTimeout("GetRSSFeed()", 300000);
};
  • 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-01T08:22:42+00:00Added an answer on June 1, 2026 at 8:22 am

    Presumably the two // ... line comments cause the rest of the javascript to be commented out. Remove the comments and see if it works?

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

Sidebar

Related Questions

Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I have a very strange problem with Android animations, I tried many different approaches
I've got a very strange problem recently. I have a code which processes inApp
I have a strange problem which probably has a very simple solution, I just
I am at a very strange problem, I have a customized JPanel, which I
We have a very strange problem which we have yet to be able to
I have a very strange problem, which took already several hours of my attention:
I have a very strange problem. I have an AsyncTask which appears to block
I got very strange problem. I have one php website which is running in
i have a very strange problem which i cannot solve at the moment. i

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.