View Single Post
  #8 (permalink)  
Old June 19th, 2009, 08:10 PM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Alright, well, I'm not sure what to suggest then. It works for me, I cleaned up the code and tested it and got the expected outcome.

I put everything in the same folder though.

So I still feel like something isn't loading, or perhaps there is something else we aren't thinking of here. You might try typing in the path to each file directly in the browser and verify that each file loads visually.

There is nothing in Firefox's error console?

Code:
<!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" xml:lang='en'>
  <head>
    <title>Example</title>
    <meta http-equiv='content-type' content='text/html; charset=utf-8' />
    <meta http-equiv='content-language' content='en-us' />
    <script type="text/javascript" src="jQuery.js"></script>
    <!-- Rename the files here -->
    <script type="text/javascript" src="test.js"></script>
    <link type="text/css" href="test.css" rel="Stylesheet"/>
  </head>
<body>
  <h4>Colors</h4>
  <ul id='tmpColors'>
    <li>Red</li>
    <li>Blue</li>
    <li>Green</li>
    <li id='tmpYellow'>Yellow</li>
    <li>Orange</li>
    <li>Purple</li>
  </ul>
 </body>
</html>
Code:
var tmpExample = {
  ready: function()
  {
    $('li#tmpYellow').prev().addClass('tmpSibling');
  }
};

$(document).ready(tmpExample.ready);
Code:
body {
  font: 16px sans-serif;
}
h4 {
  font-size: 16px;
  margin: 0 0 5px 0;
}
ul#tmpColors {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul#tmpColors li {
  margin: 1px;
  padding: 3px;
}
li.tmpSibling {
  background: #165b91;
  color: Fuchsia;
}
Reply With Quote