Hallo liebes Forum,
habe einen RSS Reader mit JS eingebaut von: RSS Reader with jQuery Mobile - jsFiddle
...leider lädt das CSS dort nicht richtig, erst bei reload. Prime-Reply ...dort der Link ganz rechts: Prime Reply - Heise
Lade ich die Datei direkt im Browser - geht's.
Gehe ich per Navigation auf die Seite, lädt das CSS nicht!
Könntet ihr mir bitte weiterhelfen? ...kann den Fehler nicht finden.
Danke für's Lesen!
Grüße aus Berlin
Ines
habe einen RSS Reader mit JS eingebaut von: RSS Reader with jQuery Mobile - jsFiddle
...leider lädt das CSS dort nicht richtig, erst bei reload. Prime-Reply ...dort der Link ganz rechts: Prime Reply - Heise
Lade ich die Datei direkt im Browser - geht's.
Gehe ich per Navigation auf die Seite, lädt das CSS nicht!
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Prime Reply - Heise</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile.structure-1.1.0.min.css" />
<link rel="stylesheet" href="themes/pf4.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<style type='text/css'>
.ui-footer .ui-btn-right {
}
.articleContent > table > tbody > tr > td > font > br {
display: none;
}
.articleContent > table > tbody > tr > td > font > br + div {
display: none;
}
.articleContent * {
font-size: medium !important;
}
</style>
</head>
<body>
<script type='text/javascript'>//<![CDATA[
// ISCPA added search filter, home icon, updated CDN-Hosted links
// forked from sumukh1's "forked: RSS Reader with jQuery Mobile" http://jsdo.it/sumukh1/4Ton
/* configuration */
var maxLength = 30;
/* writing HTML */
document.write(
'<div data-role="page" id="list" data-theme="a">' +
' <div data-role="header">' +
' <img src="logo2.png" alt="logo">' +
' <div data-role="navbar">' +
' <ul>' +
' <li><a href="index.php" >NEWS? :)</a></li>' +
' <li><a href="listing.php" >LISTING</a></li> ' +
' <li><a href="dates.php" class="ui-btn-active ui-state-persist">Heise News</a></li>' +
' </ul> ' +
' </div><!-- /navbar --> ' +
' </div>' +
' <div data-role="content">' +
' <br /> ' +
' <ul data-role="listview" data-ajax="false" data-inset="true" data-filter="true" data-theme="d" id="articleList">'
);
for(var i=1; i<=maxLength; i++){
document.write(
'<li id="list' + i + '"><a href="#article' + i + '" id="link' + i + '"> </a></li>'
);
}
document.write(
' </ul>' +
' </div>' +
'<div data-role="footer">' +
'<h4><strong>Contact Ines Hoppe:</strong><br /> ' +
'<a href="tel:+491742059812" data-role="button" data-icon="phone-touch" data-iconpos="right">T +49 174 2059812</a><br /> ' +
'<a href="mailto:info@prime-reply.de" data-role="button" data-icon="email" data-iconpos="right">info@prime-reply.de</a></h4><br /> ' +
'<a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.prime-reply.de%2Fdates.php&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices" target="_blank"><img src="http://www.w3.org/Icons/WWW/w3c_home_nb" alt="w3c"></a> ' +
'</div><!-- /footer --> ' +
'</div>'
);
for(i=1; i<=maxLength; i++){
document.write(
'<div data-role="page" id="article' + i + '">' +
' <div data-role="header" data-position="inline">' +
' <a href="http://www.prime-reply.de/dates.php" data-role="button" data-icon="home" data-back="true">Home</a>' +
' <h1 id="articleHeader' + i + '"> </h1>' +
' <a href="#" id="openButton' + i + '" data-role="button" data-icon="plus"' +
' class="ui-btn-right" rel="external">Open</a>' +
' </div>' +
' <div data-role="content">' +
' <div id="articleContent' + i + '" class="articleContent"></div>' +
' <div data-role="controlgroup" data-type="horizontal">' +
' <a href="#article' + String(i-1) + '" data-role="button" data-icon="arrow-l"' +
' data-inline="true" class="prevButton">Prev</a>' +
' <a href="#article' + String(i+1) + '" data-role="button" data-icon="arrow-r"' +
' data-inline="true" class="nextButton" data-iconpos="right">Next</a>' +
' </div>' +
' </div>' +
'</div>' +
'</div>'
);
}
/* JSONP */
$(function(){
getOnlineFeed('http://www.heise.de/developer/rss/news-atom.xml');
/*
getOnlineFeed('http://www.heise.de/developer/rss/news-atom.xml');
*/
});
/* functions */
var listEntries = function(json) {
if (!json.responseData.feed.entries) return false;
$('#widgetTitle').text(json.responseData.feed.title);
var articleLength =json.responseData.feed.entries.length;
articleLength = (articleLength > maxLength) ? maxLength : articleLength;
for (var i = 1; i <= articleLength ; i++) {
var entry = json.responseData.feed.entries[i-1];
$('#link' + i).text(entry.title);
$('#articleHeader' + i).text(entry.title);
$('#openButton' + i).attr('href', entry.link);
$('#articleContent' + i).append(entry.content);
}
$('#article1 .prevButton').remove();
$('#article' + articleLength + ' .nextButton').remove();
if (articleLength < maxLength) {
for (i = articleLength + 1; i <= maxLength; i++) {
$('#list' + i).remove();
$('#article' + i).remove();
}
}
};
var getOnlineFeed = function(url) {
var script = document.createElement('script');
script.setAttribute('src', 'http://ajax.googleapis.com/ajax/services/feed/load?callback=listEntries&hl=ja&output=json-in-script&q='
+ encodeURIComponent(url)
+ '&v=1.0&num=' + maxLength);
script.setAttribute('type', 'text/javascript');
document.documentElement.firstChild.appendChild(script);
};
var getOfflineFeed = function(url) {
var script = document.createElement('script');
script.setAttribute('src', url);
script.setAttribute('type', 'text/javascript');
document.documentElement.firstChild.appendChild(script);
};
//]]>
</script>
</body>
</html>
Könntet ihr mir bitte weiterhelfen? ...kann den Fehler nicht finden.
Danke für's Lesen!
Grüße aus Berlin
Ines