Is there a known issue with IE(7 and 8) where jquery .load() doens't function properly? My CSS isn't getting loaded onto the page. Here is my code :
This is the file which is being loaded(show_profile.php) :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" script="text/css" href="profile.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<div id="tabs"><div id="cd" class="tab_active">Contact Details</div>
</div>
</body>
</html>
This is the code for profile.css
#tabs {
color:white;
font-family:Verdana;
font-size:14px;
}
#cd{
position:absolute;
left:0px;
top:0px;
background-color:#3172A6;
}
.tab {
position:absolute;
top:0px;
}
.tab_active {
position:absolute;
top:0px;
}
On viewing the file show_profile.php independently , everything including the CSS is alright, but it just wont work when i use .load()
Please Help :(
Source: Tips4all
The css is coming from a header of the main document, not whatever you're loading.
ReplyDeleteYou can either use inline styling on the page you're loading using load(0 or specify style in some css (or using style tags) in the document that loads it.
The answer provided is correct in its entirety. The issue is because you have a page (call it A.php) that is loading this page (B.php) and the style sheet you want is only listed in B.php. This works in other browsers because they are a little more lenient on what they allow in the DOM. IE is very strict about what it does and does not do with this. The answer is to include <link rel="stylesheet" script="text/css" href="profile.css" /> in A.php
ReplyDeleteThe link element does not have a script attribute - it should be type="text/css".
ReplyDelete