Log in

View Full Version : css rule background:url...(img) is applied to <a> object , this always place the imag



leonidassavvides
11-06-2009, 07:29 AM
HEAD FIRST AJAX ©2008
css rule background:url
In page 120 : in css rule background:url...(img) is applied to <a> object , this always place the image in place of link <a> ?

#navigation a#beginners {
background: url('../images/beginnersBtn.png') no-repeat;
}
#navigation a#beginners.active {
background: url('../images/beginnersBtnActive.png') no-repeat;
}

Ajax
In page 129 : if file in Ajax:...request.open(....file.html....), file.html, does NOT exist on server we get error or NOTHING("") in responseText?

function showSchedule() {
if (request.readyState == 4) {
if (request.status == 200) {
document.getElementById("content").innerHTML = request.responseText;
}
}
}

fg123
11-08-2009, 08:22 PM
For ajax:

I think it results in a nothing situation because it won't get into the |if status == 200 | part as it returns a 404, not 200.