iare (7) [Avatar] Offline
#1
I downloaded the zip folder with the code examples, extracted to a folder on my hard drive and the index.html is there and opens but with errors, chapter 1 - 9 will not work. The links to the test pges at bottom return errors also IE cannot display this page. The active X is blocked at the start but I allow and it loads with the error on line 2 and line 8 per the box. Not sure what I need to do or what I have done incorrectly. going to the different pages, like the Lab.selectors.html do not load completely as examples in book show. Could you please advise.
bear.bibeault (675) [Avatar] Offline
#2
Re: Newbie needing help with downloaded example code from book
What errors are you getting? Except for the Ajax examples (chapter smilie all of the examples should work by just opening them in the browser even if you don't have any type of server.
iare (7) [Avatar] Offline
#3
Re: Newbie needing help with downloaded example code from book
Here are the errors as the page (index.html) loads
When loading:
The IE Info Bar advising that the scripts and ActiveX controls are blocked from running, do you want to allow - select "ALLOW Blocked Content"
After allow is checked:
Error box stating - Problems with this web page might prevent it from being displayed properly or functioning properly.......
Line: 2
Char: 1
Error: Invalid Character
Code: 0
URL: file:///C:/jQuery/index.html
Then
Error box stating - Problems with this web page might prevent it from being displayed properly or functioning properly.......
Line: 8
Char: 7
Error: Object Expected
Code: 0
URL: file:///C:/jQuery/index.html
The page appears normally, but no links are working. Running IE7, WIndows XP SP3, Windows updates up to date as of May, June's not processed as of yet. Is there any other info you need for this? Thanks for your help.
bear.bibeault (675) [Avatar] Offline
#4
Re: Newbie needing help with downloaded example code from book
"invalid character"? That's an odd one. Are you sure that the download wasn't somehow corrupted? Do the files look "normal" in a text editor?
iare (7) [Avatar] Offline
#5
Re: Newbie needing help with downloaded example code from book
The index.html in notepadd++:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>jQuery in Action Code Examples Launch Page</title>
<link rel="stylesheet" type="text/css" href="common.css">
<script type="text/javascript" src="scripts/jquery-1.2.1.js"></script>
<script type="text/javascript">
$(function(){
$('li').click(function(event){
if (event.target.tagName!='LI') return true;
var oldBlocks = $('.chapterBlock').slideUp('normal',function(){oldBlocks.remove()});
var target = this;
var folder = this.id;
$.getJSON(folder+'/index.json',function(info) {
var block = $('<div></div>');
for (var n=0;n<info.length;n++) { >
block.append('<div>'+info[n].caption+'</div>');
}
block
.css('display','none')
.addClass('chapterBlock')
.appendTo(target)
.slideDown();
})
});
});
</script>
<style>
body {
background-image: url(backg.jpg);
background-repeat: repeat-x;
}
fieldset {
margin-left: 5%;
margin-right: 5%;
}
div#container {
position: relative;
background-image: url(backg.jpg);
background-repeat: repeat-x;
margin-top: 20px;
margin-left: auto;
margin-right: auto;
width: 520px;
border: 2px solid #3db8d3;
border-right-color: #2f8ea3;
border-bottom-color: #2f8ea3;
}
</style>
</head>

<body>
<div id="container">


<fieldset id="exampleIndex">
<legend>Code examples by chapter</legend>
<div>

  • Chapter 1

  • Chapter 2

  • Chapter 3

  • Chapter 4

  • Chapter 5

  • Chapter 6

  • Chapter 7

  • Chapter 8

  • Chapter 9

  • Appendix A


</div>
</fieldset>

<fieldset>
<legend>Server setup tests</legend>
<div>


Test JSP installation



Test PHP installation


</div>
</fieldset>
</div>

</body>
</html>

It "looks" normal to me....................................
I guess I can download and unzip again?
bear.bibeault (675) [Avatar] Offline
#6
Re: Newbie needing help with downloaded example code from book
I'd try grabbing the files again. No one else has ever reported this type of issue.

Have you tried it in Firefox to see if you get better/different error indicators?
iare (7) [Avatar] Offline
#7
Re: Newbie needing help with downloaded example code from book
I did donwload and save the zip file again. Extracted and still get the same error. I do not have firefox installed, we use IE and would rather not install FireFox if I can get around it. I will install if need be.................................
iare (7) [Avatar] Offline
#8
Re: Newbie needing help with downloaded example code from book
I have reinstalled IE 7 and then applied windows updates for June. Still no luck. Each web page for the coded examples errors with the same errors. Line 2 and Line 8. Line 8 code is - $(function(){ and Line 2 is <html>. Does jquery-1.2.1.js need to be saved or installed on the computer I am running the html web page from?
bear.bibeault (675) [Avatar] Offline
#9
Re: Newbie needing help with downloaded example code from book
The jQuery file is part of the download and you should not have to do anything else.

I am at a loss to explain your issue.

Later today I'll download it myself just to make sure that the zip file itself hasn't been corrupted.

P.S. You really should be using more than one browser -- if for nothing else just to help track down errors when one misbehaves.
iare (7) [Avatar] Offline
#10
Re: Newbie needing help with downloaded example code from book
I downloaded Firefox and tested - no errors on page but chapter links will not work. Clicking on the links does nothing. The two links at bottom return errors - Firefox can't find the file at /C:/jQuery/chapter8/test.jsp and Firefox can't find the file at /C:/jQuery/chapter8/test.php. Looking at the folder of the extracted files, there is not a folder chapter8, but there are files test.jsp and test.php.
Thanks again for your help, any help is appreciated to get the code working and I can get on with understanding jQuery. Thanks
bear.bibeault (675) [Avatar] Offline
#11
Re: Newbie needing help with downloaded example code from book
All I can conclude at this point is that there is something seriously wrong with either your download capability or unzip utility.

I just downloaded the source from http://manning.com/bibeault/ and it unzipped perfectly, including the chapter8 folder. It runs perfectly when opened in a browser.
iare (7) [Avatar] Offline
#12
Re: Newbie needing help with downloaded example code from book
that did it - was using WinZip to extract - used compressed folders (windows version) - worked great and the page(s) work also! Thank you so much for your time and effort on this. Onward!
bear.bibeault (675) [Avatar] Offline
#13
Re: Newbie needing help with downloaded example code from book
Whew! Glad that's settled!