No more Monday blues, we are going straight to Tuesday.
`;
const parser = new DOMParser();
const placeholderDoc = parser.parseFromString(placeholderNewsItem, "text/xml");
const placeholderItem = placeholderDoc.getElementsByTagName('item')[0];
feedOutputListing.innerHTML = '';
const numToDisplay = 3;
for (let i = 0; i < numToDisplay; i++) {
addElement(placeholderItem, feedOutputListing);
}
} else {
// Live mode — fetch XML from feed
const newFile = 'https://math.msu.edu/_resources/data/blogs.xml' + '?v=' + new Date().getTime();
const numberOfItemsToDisplay = 3;
const selectedCategoriesRaw = '';
function decodeHtmlEntities(str) {
const txt = globalDoc.createElement('textarea');
txt.innerHTML = str;
return txt.value;
}
const selectedCategories = selectedCategoriesRaw
? selectedCategoriesRaw
.split(',')
.map(cat => decodeHtmlEntities(cat.trim()).toLowerCase())
.filter(Boolean)
: [];
getXMLDocObject(newFile, function (xmlDoc) {
const items = Array.from(xmlDoc.getElementsByTagName('item'));
const filteredItems = selectedCategories.length > 0
? items.filter(item => {
const categoriesText = item.getElementsByTagName('categories')[0]?.textContent || '';
const categories = categoriesText
.split(',')
.map(cat => cat.trim().toLowerCase())
.filter(Boolean);
return categories.some(cat => selectedCategories.includes(cat));
})
: items;
feedOutputListing.innerHTML = '';
if (filteredItems.length > 0) {
const itemsToShow = filteredItems.slice(0, Math.min(numberOfItemsToDisplay, filteredItems.length));
itemsToShow.forEach(item => addElement(item, feedOutputListing));
} else if (selectedCategories.length > 0) {
const noResults = globalDoc.createElement('p');
noResults.textContent = 'No news articles found for the selected categories.';
noResults.className = 'no-news-message';
feedOutputListing.appendChild(noResults);
}
});
}
});
})(window.document);
//
Latest News
Loading News
See more news >
Undergraduate Program
At MSU, we are preparing the next generation of problem-solvers, ready to lead in
science, technology, education, and beyond.
Learn more
GRADUATE PROGRAM
Our faculty expertise and research opportunities in Mathematics and Applied Mathematics
provide the training and experiences needed to prepare you for success.
Learn more
Mathematics Learning Center
Our experienced tutors, trained by the Math Department, will answer your questions
in a relaxed, friendly atmosphere.
Learn More
Seminars
Discover talks about a variety of mathematical topics each week from top scholars
from around the world.
Learn More
Preparing for Math at MSU
Find out information about the Mathematics Placement Service, which is required of
all incoming freshmen and transfer students.
Learn More
Give to Mathematics
There are many opportunities for donations to MSU funds which directly benefit the
Department of Mathematics.
Learn More
Upcoming Events
VIEW ALL EVENTS