Actually...I can't find any AJAX sites that work with Konqueror :-/
Main Topics
Browse All TopicsHi all
I made this very simple ajax rpc that pulls help text based on the field that currently has the focus.
Tested in Firefox and m$ explorer.
Now when I look at it in konqueror nothing happens it just loads the page and sits there looking pretty.
Knowing that the engine behind konqueror is KHTML and that Apple uses (or used to) it and Nokia as well, I really like this to work on KHTML as well.
Is there anyone who has made some AJAX interface work on Konqueror?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
some sites state that KHTML is supported, actually almost all commercial-based browser support it.
http://www.builderau.com.a
there is also AJAX ECMAScript libraries around, one of them is:
http://sourceforge.net/pro
it would help if you show us some source code.. :D
// AJAX Functions
var helptitle='helptitle';
var helpbody='helpbody';
var cache=new Array();
var http;
function inithelp()
{
http=createRequestObject()
requesthelp('init');
window.setTimeout('selectf
}
function selectfirst()
{
if(xform=document.getEleme
{
for(var counter=0; counter<xform.length; counter++)
{
current=xform[counter];
tag=current.tagName.toUppe
switch(tag)
{
case 'INPUT': attribs=getAttribs('type',
if(attribs=='file' || attribs=='text' || attribs=='radio'
|| attribs=='checkbox')
{
selectfield(current);
return false;
}
break;
case 'TEXTAREA':
case 'SELECT': selectfield(current);
return false;
break;
}
}
}
}
function selectfield(field)
{
try
{
field.focus();
field.select();
}
catch(bug)
{
;
}
}
function getAttribs(index,array)
{
if(array==null)
return null;
for(var counter=0; counter<array.length; counter++)
{
if(array[counter].name==in
return array[counter].value;
}
}
function createRequestObject()
{
var reqobj;
var browser=navigator.appName;
if(browser.indexOf('Micros
reqobj=new ActiveXObject('Microsoft.X
else
reqobj=new XMLHttpRequest();
return reqobj;
}
function requesthelp(field)
{
if(!http)
{
if(field && field.blur)
field.blur
return false;
}
if(field=='init')
{
field=new Object();
field.id='init';
}
if((cacheindex=in_cache(fi
{
get_cache(cacheindex);
}
else
{
http.open('get','contact.p
http.onreadystatechange=fi
http.send(null);
}
}
function in_cache(what)
{
if(cache.length>0)
{
try
{
for(var counter=0; counter<cache.length; counter++)
if(cache[counter].key==wha
return counter;
}
catch(bug)
{
;
}
}
return -2;
}
function get_cache(index)
{
try
{
fillhelp('|'+cache[index].
}
catch(bug)
{
;
}
}
function fillhelp(fromcache)
{
var response,update;
var cheat=true;
if(fromcache==undefined)
cheat=false;
if( (http && http.readyState==4) || (cheat))
{
response=(cheat?fromcache:
update=new Array();
if(response.indexOf('|')!=
{
update=response.split('|')
document.getElementById(he
document.getElementById(he
}
if(!cheat)
{
cachetemp=new Object();
cachetemp.key=update[0].to
cachetemp.title=update[1];
cachetemp.value=update[2];
cache[cache.length]=cachet
}
}
}
UPDATE
It seems that AJAX is functioninig on Konqueror. The problem seems to be in the fillhelp function.
After examening the value of the var response
response=(cheat?fromcache:
Konqueror reports it to be an [Object Event] whereas evaluating the contents of http.responseText directly yields propper results.
Ok, I found out where the problem is
I have a function fillhelp
fillhelp(fromcache)
This is the function called by the XMLHttpRequest event handler.
On FireFox and M$ this function is called with 0 parameters
So doing
if(fromcache==undefined)
cheat=false;
works.
On KHTML however, it seems that the event handler is called with a parameter; [Object Event]
So the function assumes the whole time that its being called with cache data instead of new data.
I added detection for the object type.
function fillhelp(fromcache)
{
var response,update;
var cheat=true;
if( (fromcache==undefined) || ( (fromcache!=undefined) && (typeof(fromcache)=='objec
cheat=false;
And everything works now!
Business Accounts
Answer for Membership
by: TimYatesPosted on 2005-11-03 at 06:29:06ID: 15216882
Can you post the code you are using?
Where does it fail? Any ideas?
Does putting
alert( "got here ok" ) ;
style debug into it help any?
Tim