Reputation: 14066
var gethtml = document.querySelector("#gethtml");
if (gethtml) {
gethtml.onclick = function () {
$('#gethtml-presenter').load('http://asd.com/rss/').fadeIn('slow');
addNotification("hello", "downloaded page");
}
}
tried this with jquery but nothing happening.
Upvotes: 0
Views: 154
Reputation: 1081
Could you do a SystemXHR? Robert Nyman's Boilerplate shows an example of this:
var crossDomainXHR = document.querySelector("#cross-domain-xhr"),
crossDomainXHRDisplay = document.querySelector("#cross-domain-xhr-display");
if (crossDomainXHR && crossDomainXHRDisplay) {
crossDomainXHR.onclick = function () {
var xhr = new XMLHttpRequest({mozSystem: true});
xhr.open("GET", "http://www.google.com", true);
xhr.onreadystatechange = function () {
if (xhr.status === 200 && xhr.readyState === 4) {
crossDomainXHRDisplay.innerHTML = "<div class='fade-in'>" + xhr.response+"</div>";
crossDomainXHRDisplay.style.display = "block";
}
}
xhr.onerror = function () {
crossDomainXHRDisplay.innerHTML = "<h4>Result from Cross-domain XHR</h4><p>Cross-domain XHR failed</p>";
crossDomainXHRDisplay.style.display = "block";
};
xhr.send();
};
}
CSS
.fade-in {
text-align: center;
animation: fadein 5s;
-moz-animation: fadein 5s; /* Firefox */
}
@keyframes fadein {
from {
opacity:0;
}
to {
opacity:1;
}
}
@-moz-keyframes fadein { /* Firefox */
from {
opacity:0;
}
to {
opacity:1;
}
}
Upvotes: 2