how?
Unified browser error handler
Posted October 16th, 2008 by irisHello,
Does anyone know some Dojo internals? I would like to create a unified browser error handler, so that I can keep better track of different browser errors. I'm sure that Dojo traps some of these errors, but it's internal and I haven't managed to get a copy of the code. I am not certain I'd know where to find it, short of looking at everything. Please advise.
Regards,
Iris
Dojo with server-side classes
Posted August 16th, 2007 by violaHi
I'm trying to learn how to use dojo and was hoping that someone would be able to offer some guidance / point me in the right direction? When trying to describe what I need help with, I've tried to simplify my examples.
So far, I have successfully been able to use dojo by using dojo.io.bind to echo some php code into an empty <div> area of a webpage (user presses button --> this sends request that returns the data --> the data is displayed in the div tag via the callback function.
i.e.
dojo.io.bind({
url: filename.php,
handler: myCallbackFunction,
formNode: dojo.byId(form_id)
});
function myCallbackFunction(type, data, evt){
if (type == 'error')
alert('Error when retrieving data from the server!');
else{
var element = document.getElementById('div_id');
if(element != null){
element.innerHTML = data;
}
}
}
The php file (in the simplest form) is little more than:
filename.php
<?
echo "Hello World";
?>
So far so good. However, what I'd now like to do is to get this data from a function that is within a php class.
i.e. filename.php would now be:
<?
class MyPHPClass {
// constructors, variables etc...
function myFunction(){
return "Hello World"; (or echo "Hello World"???)
}
}
?>
Please can you give me some guidance on how I can do this?
Thanks.
Dojo Forum