Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript and CSS Development with jQuery
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaScript and CSS Development with jQuery
This is the forum to discuss the Wrox book Beginning JavaScript and CSS Development with jQuery by Richard York; ISBN: 9780470227794
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript and CSS Development with jQuery section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 19th, 2009, 06:51 PM
Registered User
 
Join Date: Jun 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wish all his examples were in the downloadable code

Working in chapter 2. The area where prev() and next() are used.
I can't get mine to work. As far as I can tell, i've typed mine is line for line as his example shows.

It appears that the UL is not getting the css assigned to it because it still has all the decoration.

Would like to see if what he typed actually works.
Reply With Quote
  #2 (permalink)  
Old June 19th, 2009, 07:10 PM
richard.york's Avatar
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

All of the examples should be in the download. I'll look at the download package and make sure they're all there.

If you post all the code you're using I can give you a hand with troubleshooting it.
Reply With Quote
  #3 (permalink)  
Old June 19th, 2009, 07:17 PM
Registered User
 
Join Date: Jun 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by richard.york View Post
All of the examples should be in the download. I'll look at the download package and make sure they're all there.

If you post all the code you're using I can give you a hand with troubleshooting it.
Hi, i found the code. It was in the Figures folder. I didn't see it until just now.


Thanks for the offer on helping...

My HTML
Code:
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang='en'>
<head>
<title>Example</title>
<metahttp-equiv='content-type'content='text/html; charset=utf-8'/>
<metahttp-equiv='content-language'content='en-us'/>
<scripttype="text/javascript"src="../JS/jquery-1.3.2.js"></script>
<!-- Rename the files here -->
<scripttype="text/javascript"src="../JS/Example2-2.js"></script>
<linktype="text/css"href="../CSS/Example2-2.css"rel="Stylesheet"/>
</head>
<body>
<h4>Colors</h4>
<ulid='tmpColors'>
<li>Red</li>
<li>Blue</li>
<li>Green</li>
<liid='tmpYellow'>Yellow</li>
<li>Orange</li>
<li>Purple</li>
</ul>
</body>
</html>
My CSS
Code:
body
{
font: 16pxsans-serif;
}
h4
{
font-size: 16px;
margin: 005px0;
}
ul#tmpColors
{
list-style: none;
margin: 0;
padding: 0;
}
 
ul#tmpColorsli
{
margin: 1px;
padding: 3px;
}
 
li.tmpSibling
{
background: #165b91;
color: Fuchsia;
}

My JavaScript
Code:
var tmpExample = {
ready: function() {
$('li#tmpYellow').prev().addClass('tmpSibling');
}
};
$(document).ready(tmpExample.ready);

Last edited by RickBlacker; June 19th, 2009 at 08:35 PM..
Reply With Quote
  #4 (permalink)  
Old June 19th, 2009, 07:20 PM
Registered User
 
Join Date: Jun 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm.. sorry about the formatting... I thought you were supposed to wrap HTML, CSS, and JavaScript in the <code> tags when you post, but that didn't seem to help
Reply With Quote
  #5 (permalink)  
Old June 19th, 2009, 07:35 PM
richard.york's Avatar
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

OK, after some investigation I found that there was some stuff missing from the download. There's supposed to be a folder with the jQuery source code, and another folder containing various images that I use throughout the book. I have notified the Wrox folks about that, and they should have an updated download posted soon.

As for the code that you posted, it looks like it should work. I'm guessing that you may have the path to jQuery or the CSS file wrong?
Reply With Quote
  #6 (permalink)  
Old June 19th, 2009, 07:45 PM
richard.york's Avatar
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

I posted the updated download on my own site as well:

http://www.deadmarshes.com/jQuery%20Book.zip
Reply With Quote
  #7 (permalink)  
Old June 19th, 2009, 07:51 PM
Registered User
 
Join Date: Jun 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by richard.york View Post
As for the code that you posted, it looks like it should work. I'm guessing that you may have the path to jQuery or the CSS file wrong?

Hi Richard... I've tried browsing in both IE 8 and Firefox. I've used Firebug and I can see that both JS files are being found, I can also tell that the style is being applied to the html. However, only part of it... The body itself is getting the style specified in the stylesheet... However, the UL is not getting any formatting other that what it inherits from BODY

Odd.

Last edited by RickBlacker; June 19th, 2009 at 07:54 PM..
Reply With Quote
  #8 (permalink)  
Old June 19th, 2009, 08:10 PM
richard.york's Avatar
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
  #9 (permalink)  
Old June 19th, 2009, 08:40 PM
Registered User
 
Join Date: Jun 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok ok ok....

I'm an IDIOT!!!!

I was referencing the wrong JS and CSS files. I was referencing the old ones from the 2-2 example.

DAMN, that was driving me nuts, but glad I found it.


And Richard? Thanks for you AWESOME help and support!
Reply With Quote
  #10 (permalink)  
Old June 19th, 2009, 08:47 PM
richard.york's Avatar
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

No worries man, we've all been there.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't find the downloadable code trixiebr VB How-To 0 October 6th, 2004 02:59 PM
Cant find downloadable code for book cjmarek C# 4 August 19th, 2004 01:55 PM
Looking for downloadable code derpflug Wrox Book Feedback 2 December 5th, 2003 04:48 PM



All times are GMT -4. The time now is 04:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.