I'm Building a Personal Assistant with HTML5, CSS, & Javascript
This is what my current Problem is.
I Have a <div>
that contains scripts with the responses for when a Question is asked and if the question matches one it writes that response.
I Need a Script that will check if this div is empty, in Javascript, not jQuery
I need to check if the div is empty because that means there is no response.
Then for it to redirect to an the error page.
a Question & the response to it would look like this:
<script type="text/javascript">
{
var q = getValue("q");
var name = getValue("name");
}
if (q == 'Whats+up') {
document.write("Not much " + name + ".");
}
else {
}
</script>
This is the last code I tried:
<script>
var theDiv = document.getElementById("responce");
var q = getValue("q");
if(theDiv.innerHTML == ''){
window.location = 'error.html?name=Brandon&q='+q;
}
</script>