function loadAjax(ajaxTrigger,triggerAction,ajaxLoadingContentSource,ajaxLoadingContainerId) {
var trigger = document.getElementById(ajaxTrigger);
trigger.addEventListener(triggerAction, sendAjaxRequest(null,ajaxLoadingContentSource,ajaxLoadingContainerId), false);
}
function sendAjaxRequest(ev,ajaxLoadingContentSource,ajaxLoadingContainerId) {
var request = new XMLHttpRequest();
request.open("GET", ajaxLoadingContentSource, true);
request.onreadystatechange = ready(null,ajaxLoadingContainerId);
request.send(null);
}
function ready(ev,ajaxLoadingContainerId) {
var r = ev.target;
if (r.readyState != 4) return;
var div = document.getElementById(ajaxLoadingContainerId);
div.innerHTML = r.responseText;
}
It is supposed to load data content from a distant page..
But it is not working , can you please look at it and tell me where the problem is ?
It is supposed to load data content from a distant page..
so you mean that this script is running on www.yahoo.com (for example) trying to get data from/to www.google.com? the default behavior of ajax is to prevent this, if so. i have no idea how to make it work, but i've heard it's possible with tweaking.
1. If you reply to my post, and your reply would then appear directly beneath my post, DON'T QUOTE MY ENTIRE POST!!! IT'S REDUNTANT!!! IT'S ASININE!!!! IT'S REDUNDANTLY ASININE!!!!! DON'T DO IT!!!!
2. jQuery extends the functionality of JavaScript. If you don't know JavaScript, give up on that jQuery script and learn JavaScript. You'll save yourself a lot of frustration, I promise.
3. Use the [code][/code] tags. Otherwise, you may be left wondering why no one responded to your eyesore of a thread.
Bookmarks