The below function is developed in ajax. Paste the following code in the JSHeader of the form.
Create a div with the ID as "Mainbody" to place a web view.
Onload call the processAjax() function.
function processAjax() {
url=dbPath + "Viewname?openview"
if (window.XMLHttpRequest) { // Non-IE browsers
req = new XMLHttpRequest();
req.onreadystatechange = targetDiv;
try {
req.open("GET", url, true);
} catch (e) {
alert("Problem : " + e);
}
req.send(null);
} else if (window.ActiveXObject) { // IE
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = targetDiv;
req.open("GET", url, true);
req.send();
}
}
}
function targetDiv() {
if (req.readyState == 4) { // Complete
if (req.status == 200) { // OK response
var oldchild = document.getElementById("child");
if(oldchild!=null)
{
//document.forms.getElementById("Mainbody").removeChild(oldchild);
document.getElementById("Mainbody").removeChild(oldchild);
}
//-------------------------------------------------------------------
//Create a new div
var wrappingElement = document.createElement('div');
wrappingElement.setAttribute('id',"child");
//Insert response text into new div
wrappingElement.innerHTML = req.responseText;
if(req.responseText.indexOf("No documents found") > 0){
wrappingElement.innerHTML="
Your Message Hear";
Your Message Hear";
//attendee.appendChild(wrappingElement12);
}
//Append new div into mainbody
Mainbody.appendChild(wrappingElement);
setTimeout('processAjax()',10000);
} else {
// alert("Problem: " + req.statusText);
alert("Problem: Server Down1");
}
}
}
hello,
ReplyDeleteI hope I can help, I want in a new menu where options allow me to open a view, open them in a div on the same page, I do not want to use iframes or open in a new window
What's up every one, here every person is sharing these know-how, so it's fastidious to read
ReplyDeletethis website, and I used to pay a visit this weblog every day.
My homepage web design miami beach
Hey there! I'm at work browsing your blog from my new apple iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the fantastic work!
ReplyDeleteAlso visit my homepage - cheap laptops for sale
Thanks for finally writing about > "Ajax function in lotus domino to display a html view in a div innerHTML" < Liked it!
ReplyDeleteAlso visit my website ; sci-fi book blog
An impressive share! I've just forwarded this onto a co-worker who had been doing a little research on this. And he actually bought me dinner due to the fact that I discovered it for him... lol. So allow me to reword this.... Thanks for the meal!! But yeah, thanx for spending time to discuss this issue here on your website.
ReplyDeleteAlso visit my webpage - Credit Repair Reviews
Appreciate the recommendation. Let me try it out.
ReplyDeleteMy homepage ; how do you get acid reflux
There's definately a great deal to learn about this issue. I really like all the points you have made.
ReplyDeleteMy page :: Coupon Codes